urbit/include/g/a.h

96 lines
2.1 KiB
C
Raw Normal View History

2014-09-04 07:44:53 +04:00
/* include/g/a.h
**
** This file is in the public domain.
*/
/** Allocation.
**/
/* Basic allocation.
*/
2014-09-06 00:13:24 +04:00
/* u3_ca_walloc(): allocate storage measured in words.
2014-09-04 07:44:53 +04:00
*/
void*
2014-09-06 00:13:24 +04:00
u3_ca_walloc(c3_w len_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_malloc(): allocate storage measured in bytes.
2014-09-04 07:44:53 +04:00
*/
void*
2014-09-06 00:13:24 +04:00
u3_ca_malloc(c3_w len_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_free(): free storage.
2014-09-04 07:44:53 +04:00
*/
void
2014-09-06 00:13:24 +04:00
u3_ca_free(void* lag_v);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_wealloc(): word realloc.
2014-09-04 07:44:53 +04:00
*/
void*
2014-09-06 00:13:24 +04:00
u3_ca_wealloc(void* lag_v, c3_w len_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_realloc(): byte realloc.
2014-09-04 07:44:53 +04:00
*/
void*
2014-09-06 00:13:24 +04:00
u3_ca_realloc(void* lag_v, c3_w len_w);
2014-09-04 07:44:53 +04:00
/* Reference and arena control.
*/
2014-09-06 00:13:24 +04:00
/* u3_ca_gain(): gain and/or copy juniors.
2014-09-04 07:44:53 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_weak
u3_ca_gain(u3_weak som);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_lose(): lose a reference.
2014-09-04 07:44:53 +04:00
*/
void
2014-09-06 00:13:24 +04:00
u3_ca_lose(u3_weak som);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_use(): reference count.
2014-09-04 07:44:53 +04:00
*/
c3_w
2014-09-06 00:13:24 +04:00
u3_ca_use(u3_noun som);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_mark(): mark for gc, returning allocated words.
2014-09-04 07:44:53 +04:00
*/
c3_w
2014-09-06 00:13:24 +04:00
u3_ca_mark(u3_noun som);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_sweep(): sweep after gc, freeing, matching live count.
2014-09-04 07:44:53 +04:00
*/
c3_w
2014-09-06 00:13:24 +04:00
u3_ca_sweep(c3_w liv_w);
2014-09-04 07:44:53 +04:00
2014-09-16 03:56:37 +04:00
/* u3_ca_sane(): check allocator sanity.
*/
void
u3_ca_sane(void);
2014-09-04 07:44:53 +04:00
/* Atoms from proto-atoms.
*/
2014-09-06 00:13:24 +04:00
/* u3_ca_slab(): create a length-bounded proto-atom.
2014-09-04 07:44:53 +04:00
*/
c3_w*
2014-09-06 00:13:24 +04:00
u3_ca_slab(c3_w len_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_slaq(): u3_ca_slaq() with a defined blocksize.
2014-09-04 07:44:53 +04:00
*/
c3_w*
2014-09-06 00:13:24 +04:00
u3_ca_slaq(c3_g met_g, c3_w len_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_malt(): measure and finish a proto-atom.
2014-09-04 07:44:53 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ca_malt(c3_w* sal_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_moot(): finish a pre-measured proto-atom; dangerous.
2014-09-04 07:44:53 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ca_moot(c3_w* sal_w);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ca_mint(): finish a measured proto-atom.
2014-09-04 07:44:53 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ca_mint(c3_w* sal_w, c3_w len_w);
2014-09-04 07:44:53 +04:00