×

Flexible data structure layout for data structure including bit-field data members

  • US 5,884,314 A
  • Filed: 07/30/1997
  • Issued: 03/16/1999
  • Est. Priority Date: 06/07/1995
  • Status: Expired due to Term
First Claim
Patent Images

1. A method for laying out data members of a data structure, the data members including bit-field data members, the method comprising the steps of:

  • accepting as input i) an identifier for each data member, ii) a data type for each data member, and iii) a data type size for each data member;

    accepting as input the value of a plurality of parameters specified by a user, the parameters including;

    a first parameter that indicates a minimum alignment requirement of the structure;

    a second parameter that indicates the degree to which the structure is to be packed;

    a third parameter that indicates whether or not the allocation unit of a bit-field data member can overlap with the allocation unit of a data member for which memory has already been allocated;

    a fourth parameter that indicates, if the structure is an unpacked structure, an increment that defines where a new allocation unit for a bit-field data member will start relative to the allocation unit for the previous data member; and

    a fifth parameter that indicates whether to allocate an unused portion of the allocation unit of the last data member for which a member offset was determined;

    sequentially determining a member offset for each of the data members, wherein;

    the determination of the member offset of each data member is dependent upon whether the data member is a bit-field data member or not; and

    the determination of one or more of the member offsets is dependent upon the one or more values of the parameters; and

    determining a size of the data structure.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×