Skip to content
Permalink
b5fa1b28a8
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
27 lines (22 sloc) 1.02 KB
/* Main interface for array-based linked-list allocator */
// core methods
#define createLLArr(type) SEG_ARR_CREATE(type)
#define useLLArr(type) SEG_ARR_USE(type)
#define initLLArr(type) SEG_ARR_INIT(type)
#define clearLLArr(type) SEG_ARR_CLEANUP(type)
// checks whether a segment is empty/NULL/unusable
#define segNull(seg) DYNARR_SEG_NULL(seg)
// checks whether a segment is not empty/NULL/unusable
#define segNotNull(seg) DYNARR_SEG_NOT_NULL(seg)
// checks whether there is an existing allocation error
#define isAllocError(type) SEG_BANK_ALLOC_VIOLATION(type)
// allocate a new segment for given type
// returns an object of given type
// may be NULL_SEG if some problem occurs
// check using segNull(type, seg) macro
#define allocSeg(type) SEG_ARR_ALLOC_SEG_FUNC(type)()
// release/free a segment for given type
#define freeSeg(type, seg) SEG_ARR_SEG_FREE_SET(type, seg)
// segment at a particular index
// use segNull() to check validity of the returned segment
#define getSegAt(type, index) SEG_ARR_GET_SEG(type, index)