Permalink
Cannot retrieve contributors at this time
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?
dynarrc/dynarrc/dynarrc.interface.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (22 sloc)
1.02 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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) |