source: trunk/mem.h @ 1

Last change on this file since 1 was 1, checked in by moo, 8 years ago

initial import to online

File size: 916 bytes
RevLine 
[1]1typedef struct _xc_mem_t xc_mem_t;
2typedef struct _xc_block_t xc_block_t;
3typedef unsigned int xc_memsize_t;
4
5void *xc_mem_malloc(xc_mem_t *mem, xc_memsize_t size);
6int xc_mem_free(xc_mem_t *mem, const void *p);
7void *xc_mem_calloc(xc_mem_t *mem, xc_memsize_t memb, xc_memsize_t size);
8void *xc_mem_realloc(xc_mem_t *mem, const void *p, xc_memsize_t size);
9char *xc_mem_strndup(xc_mem_t *mem, const char *str, xc_memsize_t len);
10char *xc_mem_strdup(xc_mem_t *mem, const char *str);
11const xc_block_t *xc_mem_freeblock_first(xc_mem_t *mem);
12const xc_block_t *xc_mem_freeblock_next(const xc_block_t *block);
13xc_memsize_t xc_mem_block_size(const xc_block_t *block);
14xc_memsize_t xc_mem_block_offset(const xc_mem_t *mem, const xc_block_t *block);
15
16xc_memsize_t xc_mem_avail(xc_mem_t *mem);
17xc_memsize_t xc_mem_size(xc_mem_t *mem);
18
19xc_mem_t *xc_mem_init(void *ptr, xc_memsize_t size);
20void xc_mem_destroy(xc_mem_t *mem);
Note: See TracBrowser for help on using the repository browser.