Allocation of memory within a data type-specific memory heap
AssigneeApple Inc.
InventorFilip J. Pizlo
Life of this patent
Estimating the term…
Abstract
One embodiment provides for a non-transitory machine-readable medium storing instructions to cause one or more processors to perform operations comprising receiving an instruction to dynamically allocate memory for an object of a data type and dynamically allocating memory for the object from a heap instance that is specific to the data type for the object, the heap instance including a memory allocator for the data type, the memory allocator generated at compile time for the instruction based on a specification of the data type for the heap instance.
Claims20
A system comprising:
- a memory;
- and
- one or more processors configured to:
- initialize a memory heap that is specific to a data type, the memory heap including a first directory, the first directory to track a first set of memory pages;
- associate an allocator and a deallocator with the memory heap, the allocator and deallocator each specific to the data type associated with the memory heap;
- configure the first directory with a header and a page map, the header including a bitvector to indicate status for memory pages within the first set of memory pages and the page map indicating memory addresses for the first set of memory pages, wherein memory pages of the first set of memory pages are associated with an index number;
- and
- allocate memory within the memory heap to store an object of the data type.
A method comprising:
- initializing a memory heap that is specific to a data type, the memory heap including a first directory, the first directory to track a first set of memory pages;
- associating an allocator and a deallocator with the memory heap, the allocator and deallocator each specific to the data type associated with the memory heap;
- configuring the first directory with a header and a page map, the header including a bitvector to indicate status for memory pages within the first set of memory pages and the page map indicating memory addresses for the first set of memory pages, wherein memory pages of the first set of memory pages are associated with an index number;
- and
- allocating memory within the memory heap to store an object of the data type.
A non-transitory machine readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
- initializing a memory heap that is specific to a data type, the memory heap including a first directory, the first directory to track a first set of memory pages;
- associating an allocator and a deallocator with the memory heap, the allocator and the deallocator each specific to the data type associated with the memory heap;
- configuring the first directory with a header and a page map, the header including a bitvector to indicate status for memory pages within the first set of memory pages and the page map indicating memory addresses for the first set of memory pages, wherein memory pages of the first set of memory pages are associated with an index number;
- and
- allocating memory within the memory heap to store an object of the data type.
Dependencies are inferred from the claim text.