libcute 0.1
Loading...
Searching...
No Matches
Classes | Macros | Functions
gpallocator.h File Reference
#include "collection/bitmap.h"
#include "memory/allocator.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for gpallocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cu_GPAllocator
 
struct  cu_GPAllocator_Config
 

Macros

#define CU_GPA_BUCKET_SIZE   4096
 
#define CU_GPA_NUM_SMALL_BUCKETS   16
 
#define CU_GPA_CANARY   0x9232a6ff85dff10fULL
 

Functions

cu_Allocator cu_Allocator_GPAllocator (cu_GPAllocator *alloc, cu_GPAllocator_Config config)
 
void cu_GPAllocator_destroy (cu_GPAllocator *alloc)
 

Detailed Description

General purpose allocator.

Macro Definition Documentation

◆ CU_GPA_BUCKET_SIZE

#define CU_GPA_BUCKET_SIZE   4096

default page size for buckets

◆ CU_GPA_CANARY

#define CU_GPA_CANARY   0x9232a6ff85dff10fULL

bucket canary value

◆ CU_GPA_NUM_SMALL_BUCKETS

#define CU_GPA_NUM_SMALL_BUCKETS   16

number of size classes

Function Documentation

◆ cu_Allocator_GPAllocator()

cu_Allocator cu_Allocator_GPAllocator ( cu_GPAllocator alloc,
cu_GPAllocator_Config  config 
)

Create a GP allocator using the given configuration.

Here is the call graph for this function:

◆ cu_GPAllocator_destroy()

void cu_GPAllocator_destroy ( cu_GPAllocator alloc)

Release all buckets and large allocations.