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