BRL-CAD
mem.h File Reference
#include "common.h"
#include "vmath.h"
#include "rt/defines.h"
Include dependency graph for mem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mem_map
 

Macros

#define MAP_NULL   ((struct mem_map *) 0)
 

Functions

size_t rt_memalloc (struct mem_map **pp, size_t size)
 
struct mem_maprt_memalloc_nosplit (struct mem_map **pp, size_t size)
 
void rt_memfree (struct mem_map **pp, size_t size, b_off_t addr)
 
void rt_mempurge (struct mem_map **pp)
 
void rt_memclose (void)
 

Macro Definition Documentation

◆ MAP_NULL

#define MAP_NULL   ((struct mem_map *) 0)

Definition at line 42 of file mem.h.

Function Documentation

◆ rt_memalloc()

size_t rt_memalloc ( struct mem_map **  pp,
size_t  size 
)

Takes: & pointer of map, size.

Returns: NULL Error address Otherwise

Comments: Algorithm is first fit.

◆ rt_memalloc_nosplit()

struct mem_map * rt_memalloc_nosplit ( struct mem_map **  pp,
size_t  size 
)

Takes: & pointer of map, size.

Returns: NULL Error address Otherwise

Comments: Algorithm is BEST fit.

◆ rt_memfree()

void rt_memfree ( struct mem_map **  pp,
size_t  size,
b_off_t  addr 
)

Takes: size, address.

Comments: The routine does not check for wrap around when increasing sizes or changing addresses. Other wrap-around conditions are flagged.

◆ rt_mempurge()

void rt_mempurge ( struct mem_map **  pp)

Take everything on the current memory chain, and place it on the freelist.

◆ rt_memclose()

void rt_memclose ( void  )

Return all the storage used by the rt_mem_freemap.