Attribute Macro global_heap_allocator_slot_map

#[global_heap_allocator_slot_map]
Expand description

A macro attribute to map allocation layouts to slot sizes and types.

In OSTD, both slab slots and large slots are used to serve heap allocations. Slab slots must come from slabs of fixed sizes, while large slots can be allocated by frame allocation, with sizes being multiples of pages. OSTD must know the user’s decision on the size and type of a slot to serve an allocation with a given layout.

This macro should be used to annotate a function that maps a layout to the slot size and the type. The function should return None if the layout is not supported.

The annotated function should be idempotent, meaning the result should be the same for the same layout. OSDK enforces this by only allowing the function to be const.