BRL-CAD
#include "common.h"
#include <stddef.h>
#include "bu/defines.h"
#include "bu/magic.h"
#include <limits.h>
Include dependency graph for malloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bu_pool
 

Macros

#define BU_PAGE_SIZE   4096
 
#define BU_GET(_ptr, _type)   _ptr = (_type *)bu_calloc(1, sizeof(_type), #_type " (BU_GET) " CPP_FILELINE)
 
#define BU_PUT(_ptr, _type)   do { *(uint8_t *)(_type *)(_ptr) = /*zap*/ 0; bu_free(_ptr, #_type " (BU_PUT) " CPP_FILELINE); _ptr = NULL; } while (0)
 
#define BU_ALLOC(_ptr, _type)   _ptr = (_type *)bu_calloc(1, sizeof(_type), #_type " (BU_ALLOC) " CPP_FILELINE)
 
#define BU_FREE(_ptr, _type)   do { bu_free(_ptr, #_type " (BU_FREE) " CPP_FILELINE); _ptr = (_type *)NULL; } while (0)
 

Typedefs

typedef int(* bu_heap_func_t) (const char *,...)
 

Functions

void * bu_malloc (size_t siz, const char *str)
 
void * bu_calloc (size_t nelem, size_t elsize, const char *str)
 
void bu_free (void *ptr, const char *str)
 
void * bu_realloc (void *ptr, size_t siz, const char *str)
 
int bu_malloc_len_roundup (int nbytes)
 
void * bu_heap_get (size_t sz)
 
void bu_heap_put (void *ptr, size_t sz)
 
bu_heap_func_t bu_heap_log (bu_heap_func_t log)
 
struct bu_poolbu_pool_create (size_t block_size)
 
void * bu_pool_alloc (struct bu_pool *pool, size_t nelem, size_t elsize)
 
void bu_pool_delete (struct bu_pool *pool)
 
int bu_shmget (int *shmid, char **shared_memory, int key, size_t size)
 
void bu_prmem (const char *str)
 
void bu_ck_malloc_ptr (void *ptr, const char *str)
 
int bu_mem_barriercheck (void)
 

Variables

size_t bu_n_malloc
 
size_t bu_n_realloc
 
size_t bu_n_free
 

Function Documentation

◆ bu_prmem()

void bu_prmem ( const char *  str)

◆ bu_ck_malloc_ptr()

void bu_ck_malloc_ptr ( void *  ptr,
const char *  str 
)

◆ bu_mem_barriercheck()

int bu_mem_barriercheck ( void  )