typedef struct FixAlloc FixAlloc;
typedef struct MCentral MCentral;
-typedef struct MCache MCache;
typedef struct MHeap MHeap;
typedef struct MHeapMap MHeapMap;
typedef struct MHeapMapCache MHeapMapCache;
// Statistics.
// Shared with Go: if you edit this structure, also edit ../lib/malloc.go.
-typedef struct MStats MStats;
struct MStats
{
uint64 alloc;
// Central list of free objects of a given size.
-typedef struct MCentral MCentral;
struct MCentral
{
Lock;
// On the other hand, it's just virtual address space: most of
// the memory is never going to be touched, thus never paged in.
-typedef struct MHeapMap MHeapMap;
typedef struct MHeapMapNode2 MHeapMapNode2;
typedef struct MHeapMapNode3 MHeapMapNode3;
MHeapMapCache_HashBits = 12
};
-typedef struct MHeapMapCache MHeapMapCache;
struct MHeapMapCache
{
uintptr array[1<<MHeapMapCache_HashBits];
// Main malloc heap.
// The heap itself is the "free[]" and "large" arrays,
// but all the other global data is here too.
-typedef struct MHeap MHeap;
struct MHeap
{
Lock;
MSpan* MHeap_Alloc(MHeap *h, uintptr npage, int32 sizeclass);
void MHeap_Free(MHeap *h, MSpan *s);
MSpan* MHeap_Lookup(MHeap *h, PageID p);
-