ApertureOS
Data Structures | Macros | Functions | Variables
umalloc.c File Reference
#include "umalloc.h"
#include "managers.h"
#include "utils/common.h"
#include "utils/native.h"
Include dependency graph for umalloc.c:

Data Structures

struct  umalloc_info
 

Macros

#define IS_FREE(x)   ((x->pointer & 1) == 0)
 
#define IS_USED(x)   ((x->pointer & 1) == 1)
 
#define MARK_FREE(x)   (x->pointer = CLEAR_BIT(x->pointer, 0))
 
#define MARK_USED(x)   (x->pointer = SET_BIT(x->pointer, 0))
 
#define GET_ADDR(x)   (x->pointer & ~1)
 
#define SET_ADDR(x, val)   (x->pointer = val | (x->pointer & 1))
 
#define STORE_SIZE   MB(128)
 

Functions

void umalloc_init ()
 
void ucompact ()
 
void * umalloc (size_t size)
 
void ufree (void *addr)
 

Variables

void * u_pages_base_addr
 
int u_max_allocs = 0
 
uint32_t u_free_space = 0
 
umalloc_infou_allocation_info = NULL
 
umalloc_infou_next_free_block = NULL
 
bool u_retry = FALSE
 

Macro Definition Documentation

#define GET_ADDR (   x)    (x->pointer & ~1)
#define IS_FREE (   x)    ((x->pointer & 1) == 0)
#define IS_USED (   x)    ((x->pointer & 1) == 1)
#define MARK_FREE (   x)    (x->pointer = CLEAR_BIT(x->pointer, 0))
#define MARK_USED (   x)    (x->pointer = SET_BIT(x->pointer, 0))
#define SET_ADDR (   x,
  val 
)    (x->pointer = val | (x->pointer & 1))
#define STORE_SIZE   MB(128)

Function Documentation

void ucompact ( )
void ufree ( void *  addr)
void* umalloc ( size_t  size)
void umalloc_init ( )

Variable Documentation

umalloc_info* u_allocation_info = NULL
uint32_t u_free_space = 0
int u_max_allocs = 0
umalloc_info * u_next_free_block = NULL
void* u_pages_base_addr
bool u_retry = FALSE