[Migrated content. Thread originally posted on 11 October 2011]
Using Net Express 5.1/Windows XP Pro SP3.I have a program in which I'm dynamically allocating memory to contain a variable length table.
Calling "CBL-ALLOC_MEM" works fine - I am able to populate the table and display its contents, as required.
When I try to 'free' the memory I get a "252 Memory corruption detected (addr=xxxxxxx type 30/4)".
The program stops - as shown in Animator - on the 'call "CBL_FREE_MEM"' line as shown:
call "CBL_FREE_MEM" *> crashes on this line - memory corrupted
using by value memory-pointer
returning status-code
if not status-code = 0
move "Failed to release memory" to message-line
perform display-message
stop run
end-if.
The program doesn't even reach the 'if not status-code = 0' line.
I've set up a cobopt.cfg file containing 'set memory_strategy=0x40000000' but this has no effect.
Not sure how to proceed from here. I don't want to set up a 'static' table in Working Storage since that would be a complete waste of space for a function that will probably be only used once on each running of the program. Any clues appreciated.
TIA