Ylva And Malin
Data Structures | Macros | Enumerations | Functions
ym_allocator.h File Reference
#include <ym_core.h>
Include dependency graph for ym_allocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ym_allocator_cfg
 
struct  ym_allocator
 

Macros

#define YM_ALLOCATOR_SLOT_REGION_COUNT   4
 
#define YM_MEMORY_TRACKING
 
#define YM_ALLOCATE(allocator, size, ptr)   ym_allocate(allocator, size, ptr, __FILE__, __LINE__);
 
#define YM_DEALLOCATE(allocator, size, ptr)   ym_deallocate(allocator, size, ptr, __FILE__, __LINE__);
 

Enumerations

enum  ym_alloc_strategy {
  ym_alloc_strategy_stack,
  ym_alloc_strategy_pool,
  ym_alloc_strategy_linear,
  ym_alloc_strategy_region
}
 

Functions

ym_errc ym_create_allocator (ym_alloc_strategy strategy, void *memory, uint size, ym_allocator_cfg *allocator_cfg, ym_allocator *out_allocator)
 
ym_errc ym_destroy_allocator (ym_allocator *allocator)
 
ym_errc ym_allocate (ym_allocator *allocator, int size, void **ptr, char *file, int line)
 
ym_errc ym_deallocate (ym_allocator *allocator, int size, void *ptr, char *file, int line)
 

Macro Definition Documentation

#define YM_ALLOCATE (   allocator,
  size,
  ptr 
)    ym_allocate(allocator, size, ptr, __FILE__, __LINE__);
#define YM_ALLOCATOR_SLOT_REGION_COUNT   4
#define YM_DEALLOCATE (   allocator,
  size,
  ptr 
)    ym_deallocate(allocator, size, ptr, __FILE__, __LINE__);
#define YM_MEMORY_TRACKING

Enumeration Type Documentation

Enumerator
ym_alloc_strategy_stack 
ym_alloc_strategy_pool 
ym_alloc_strategy_linear 
ym_alloc_strategy_region 

Function Documentation

ym_errc ym_allocate ( ym_allocator allocator,
int  size,
void **  ptr,
char *  file,
int  line 
)
ym_errc ym_create_allocator ( ym_alloc_strategy  strategy,
void memory,
uint  size,
ym_allocator_cfg allocator_cfg,
ym_allocator out_allocator 
)

Here is the caller graph for this function:

ym_errc ym_deallocate ( ym_allocator allocator,
int  size,
void ptr,
char *  file,
int  line 
)
ym_errc ym_destroy_allocator ( ym_allocator allocator)

Here is the call graph for this function: