47 #define ABC_MEM_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
48 #define ABC_MEM_CALLOC(type, num) ((type *) calloc((num), sizeof(type)))
49 #define ABC_MEM_FALLOC(type, num) ((type *) memset(malloc(sizeof(type) * (num)), 0xff, sizeof(type) * (num)))
50 #define ABC_MEM_FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
51 #define ABC_MEM_REALLOC(type, obj, num) \
52 ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
53 ((type *) malloc(sizeof(type) * (num))))
74 if ( nCap > 0 && nCap < 8 )
112 if ( p->nCap >= nCapMin )
131 if ( p->nSize == p->nCap )
138 p->pArray[p->nSize++] = Entry;
156 qsort( (
void *)p->pArray, p->nSize,
sizeof(
void *),
157 (int (*)(
const void *,
const void *)) Vec_MemSortCompare );
231 void ** pBeg = vArr->pArray;
232 void ** pBeg1 = vArr1->pArray;
233 void ** pBeg2 = vArr2->pArray;
234 void ** pEnd1 = vArr1->pArray + vArr1->nSize;
235 void ** pEnd2 = vArr2->pArray + vArr2->nSize;
236 while ( pBeg1 < pEnd1 && pBeg2 < pEnd2 )
238 if ( *pBeg1 == *pBeg2 )
240 else if ( *pBeg1 < *pBeg2 )
249 while ( pBeg1 < pEnd1 )
254 vArr->nSize = pBeg - vArr->pArray;
255 assert( vArr->nSize <= vArr->nCap );
256 assert( vArr->nSize >= vArr1->nSize );
257 assert( vArr->nSize >= vArr2->nSize );
int Util_ComparePointers(void **pp1, void **pp2)
void * Util_MemRecAlloc(void *pMem)
BASIC TYPES ///.
void Util_MemRecRecycle()
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
#define ABC_MEM_REALLOC(type, obj, num)
void * Util_MemRecFree(void *pMem)
static Vec_Mem_t * Vec_MemAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void * s_vAllocs
INCLUDES ///.
static Vec_Mem_t * Vec_MemTwoMerge(Vec_Mem_t *vArr1, Vec_Mem_t *vArr2)
#define ABC_NAMESPACE_IMPL_END
static void Vec_MemFree(Vec_Mem_t *p)
static void Vec_MemSort(Vec_Mem_t *p, int(*Vec_MemSortCompare)())
#define ABC_NAMESPACE_IMPL_START
#define ABC_MEM_FREE(obj)
static void Vec_MemPush(Vec_Mem_t *p, void *Entry)
static void Vec_MemGrow(Vec_Mem_t *p, int nCapMin)
#define ABC_MEM_ALLOC(type, num)