No AppGameKit does not pop anything from the memblock with calling createfilefrommemblock, it leaves the buffer intact, AppGameKit does use an internal list to keep track of the memblocks but this merely holds the pointer address and gives you an unsigned int for ease of reference, the same list class is used everywhere in AppGameKit (for sprites, objects, text, edit etc etc) so I can say with certainly that this is not the problem or it would be bugging out in every project.
This:
Do
i = CreateMemblock(1024 * 1024 * 64)
sync()
Loop
Is allocating 67MB per frame??, I would expect it to crash! lol
when freeing the memory, it does not crash
Do
i = CreateMemblock(1024 * 1024 * 64)
DeleteMemblock(i)
sync()
Loop
The problem is not the memblock its the way its being used.
I am 99.99% sure this is an overrun issue causing an IMA (Invalid Memory Access)
try freeing the buffer once in a while and reallocating, also some things to bear in mind
the max buffer size AppGameKit will allow is < 100000000 bytes
agk allocates the memory as:
pMem->m_pData = new unsigned char[ size ];
so if you have a signed char in your data you will get overrun? (as I understand it?)
Quote: "signed char, which gives you at least the -127 to 127 range. (-128 to 127 is common)
unsigned char, which gives you at least the 0 to 255 range."
Edit: but I could be wrong on that, not great on memory stuff myself, I think the *sign* takes an extra byte or 2, maybe someone with more knowledge/experience can chime in here?