Oso Memory Profiler

4.7 - OsoMP_NewAttribute

Inserts a new attribute type into the profile.

void OsoMP_NewAttribute( UInt8              id,
                         OsoMPAttributeType type,
                         const char*        name );
id Application defined unique identifer for this attribute type.

This value must be greater than ATTRIBUTEID_FirstUser (20) and, obviously, less than 256.
type Defines the data type of this attribute. This can be one of the following values:
  • ATTRIBUTETYPE_Integer32
    32-bit signed integer.

  • ATTRIBUTETYPE_Integer64
    64-bit signed integer.

  • ATTRIBUTETYPE_Float
    32-bit float.

  • ATTRIBUTETYPE_String
    UTF8 encoded text.

  • ATTRIBUTETYPE_Filename
    Fully qualified UTF8 absolute path.

  • ATTRIBUTETYPE_URL
    UTF8 encoded URL.

  • ATTRIBUTETYPE_Time
    Signed 64-bit microsecond counter since 1970-01-01 00:00:00 GMT (the Unix time epoch).

  • ATTRIBUTETYPE_Frequency
    32-bit unsigned integer denoting Hz.
name Specifies the name that will be displayed to the user in the Oso Memory Profiler for attributes of this type.
Attributes are a way to add custom data to each allocation, free, or message event. By registering attribute types beforehand, the amount of information that needs to be stored with each event can be reduced.

Attributes must be added before they are referenced by any memory block or block type.