106#if !defined(VINLINE_MALOC)
216# define Vset_num(thee) ((thee)->numT)
227# define Vset_access(thee,i) ( \
228 ((i >= 0) && (i < thee->numT)) \
229 ? &((thee)->table[ (i)>>(thee)->blockPower ] \
230 [ (thee)->sizeT*((i)&(thee)->blockModulo) ]) \
242# define Vset_create(thee) ( \
243 ( ((((thee)->numT)>>(thee)->blockPower) >= (thee)->numBlocks) \
244 || ((((thee)->numT+1)%(thee)->prtT) == 0) ) \
245 ? (Vset_createLast((thee))) \
246 : (++((thee)->numT), (Vset_access((thee),(thee)->numT-1))) \
257# define Vset_first(thee) ( \
259 Vset_access((thee), (thee)->curT) \
270# define Vset_last(thee) ( \
271 (thee)->curT = (thee)->numT-1, \
272 Vset_access((thee), (thee)->curT) \
283# define Vset_next(thee) ( \
285 ((thee)->curT < (thee)->numT) \
286 ? Vset_access((thee), (thee)->curT) \
298# define Vset_prev(thee) ( \
300 ((thee)->curT >= 0) \
301 ? Vset_access((thee), (thee)->curT) \
313# define Vset_peekFirst(thee) ( \
314 Vset_access((thee), 0) \
325# define Vset_peekLast(thee) ( \
326 Vset_access((thee), (thee)->numT-1) \
337# define Vset_destroy(thee) ( \
338 ( ((((thee)->numT-1)>>(thee)->blockPower) < (thee)->numBlocks-1) \
339 || ((thee)->numT == 1) || ((((thee)->numT)%(thee)->prtT) == 0) ) \
340 ? (Vset_destroyLast((thee))) : (void)(((thee)->numT)--) \
357 const char *tname,
int tsize,
int tmaxNum,
int ioKey);
423 int *tnum,
int *tsize,
int *tVecUse,
int *tVecMal,
int *tVecOhd);
The base (or foundation) header for MALOC.
#define VMAX_ARGLEN
Global constant.
Definition maloc_base.h:227
Class Vmem: A safer, object-oriented, malloc/free object.
Header file for an ISO C [V]irtual [N]umerical [M]achine.
char * Vset_peekFirst(Vset *thee)
Return the first object in the set.
char * Vset_prev(Vset *thee)
Return the prev object in the set.
void Vset_dtor(Vset **thee)
Destroy the set object.
char * Vset_first(Vset *thee)
Return the first object in the set.
Vset * Vset_ctor(Vmem *vmem, const char *tname, int tsize, int tmaxNum, int ioKey)
Construct the set object.
void Vset_reset(Vset *thee)
Release all Ram controlled by this (thee) and re-initialize.
char * Vset_next(Vset *thee)
Return the next object in the set.
void Vset_initData(Vset *thee)
Initialize the Vset data (thee).
void Vset_destroyLast(Vset *thee)
Free up the object currently on the end of the list.
char * Vset_create(Vset *thee)
Create an object on the end of the list.
void Vset_memChk(Vset *thee)
Print the exact current malloc usage.
void Vset_check(Vset *thee, int *tnum, int *tsize, int *tVecUse, int *tVecMal, int *tVecOhd)
Get and return the RAM Control Block (thee) information.
int Vset_num(Vset *thee)
Return the number of things currently in the list.
char * Vset_peekLast(Vset *thee)
Return the last object in the set.
char * Vset_last(Vset *thee)
Return the last object in the set.
void Vset_destroy(Vset *thee)
Delete an object from the end of the list.
char * Vset_createLast(Vset *thee)
Create an object on the end of the list.
char * Vset_access(Vset *thee, int i)
Access an object in an arbitrary place in the list.
Contains public data members for Vmem class.
Definition vmem.h:57
Contains public data members for Vset class.
Definition vset.h:57
int blockModulo
=blockSize-1; for determining which block fast
Definition vset.h:88
char nameT[VMAX_ARGLEN]
name of object we are managing
Definition vset.h:68
int iMadeVmem
did i make vmem or was it inherited
Definition vset.h:62
int blockSize
blocksize is 2^(blockPower)
Definition vset.h:84
char ** table
list of pointers to blocks of storage we manage
Definition vset.h:91
int numBlocks
total number of allocated blocks
Definition vset.h:73
int prtT
for i/o at appropriate block creation/deletion
Definition vset.h:77
Vmem * vmem
the memory manager
Definition vset.h:60
int curT
the current "T" object in our collection
Definition vset.h:65
int blockMax
num blocks = blockMax=(maxObjects/blockSize)
Definition vset.h:86
int sizeT
size of the object in bytes
Definition vset.h:70
int blockPower
power of 2 for blocksize (e.g., =10, or =16)
Definition vset.h:82
int maxObjects
number of objects to manage (user specified)
Definition vset.h:80
int numT
the global "T" counter – how many "T"s in list
Definition vset.h:75