Original Post
I am attempting to make a general memory module that allocates initially a large block and than generates and manages that block through out the game procedures.
BYTE * memoryPool = malloc (10000000);
BYTE * temp = getPointerFromGeneralMemPool (1000); /*get pointer that is size 1000 within memoryPool */
now, in getPointerFromGeneralMemPool (xxx), how do i force the pointer that will be returned not to more than the defined size. Cuz, if a malloc a pointer to 100 bytes and go beyond that you get crashes (which, is oddly what I want). But, since I have already allocated a large block initially, and i just return a pointer within that block it wont crash. I dont want procedures to be able to corrupt the memoryPool by having individual pointers within that large block overlap accidently. I hope that explains its. Thanks.
K2