Oso Memory Profiler

2.4 - Block types

Block types can be used to differentiate between different classes of memory block or resource within a profile. You might want to visually separate memory used for data from memory used for images or sound effects, for example. Or you might want to separate out memory allocated from third party libraries, or different sub-modules of your own code.

Different block types are coloured differently in all parts of the Oso Memory Profiler, and may, where applicable, utilise their own custom format strings to help identify them.

By default the Oso Memory Profiler supports two types of block:

OSOMP_MemoryBlock Memory blocks are the default type of block. If you don't have a custom block type defined that you can pass to OsoMP_Allocate and OsoMP_Free, you should use this type.
OSOMP_MemoryBucket Memory buckets are a convenience type that should be considered as pools that memory blocks and other resource are allocated from.

Memory buckets are grouped separately in the block lists, appear in the threaded timelines, and can be selected as with any other block, but they do not contribute to the usage graphs, nor do they appear in the memory maps.
In addition to the above standard types, an application is free to register additional block types for whatever purposes are required. Registration is achieved through calls to OsoMP_NewBlockType, and should typically be done from your implementation of OsoMP_InitialiseCallback.

All block types use 8-bit IDs to identify them, so therefore have a maximum value of 255 (OSOMP_LastBlockType). In addition, custom block type IDs must be equal to or greater than OSOMP_FirstUserBlockType (10).