So in tB
if Heap_Size(myHeap) then
' its for sure a pointer to some allocated heap
' and it's size is known
endif
and almost all of my functions need this size to calculate with. If I would have to pass it in each call would be very cumbersome. To be fast I can not afford to keep track on each memory-blocks size and this size is essential to all element-, node- and organizer-functions I wrote.
I think it would be much better to have it ALL done by O2 - the calculating of positions as well as the storing to memory and it probably would not make much sense to use tB-heap-functionalities and calculate in O2.
I would appreciate if GetMemory(1000) would instantly allocate 1004 bytes and return pointer to byte 5 as starting position. The other four bytes in front could tell the size. But probably for compatibility-reasons it's not possible to change the existing GetMemory-function and I would have to add one dword in front myself and write some wrappers to Get/FreeMemory...On the other hand: this size has been stored somewhere anyway - how else would FreeMemory know how much to deallocate? So a SizeOf( Memory p ) should be possible somehow...
And another question: is there something like SetAt(myVar, myAddress) in tB, to place some virtual overlay to another position or 0 to "neutralize" it?
Or would I need to use somewhat like Redim myVar At myAddress ?
Once again: I've read in oxyygen-helpfile about memory:
Remarks
Currently up to 1024 getmemory allocations are supported - thereafter the oldest get recycled. But if the strings are freed with freememory in the reverse order in which they were created, (like a stack) then this limitation does not apply.
is that still the case?
Bookmarks