Re: ? free()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bernie Ryan wrote:
> That is why the interpeter when it sees a FREE() function
> must determine what variable originally allocated the memory
> and set that variable to zero.
> Then if you try to use that variable, or any copies of it,
> the use will cause an error instead of probigate the error
> throught the program.

What you are asking isn't practical, but what you could do
is write "garbage" into a block just before freeing it. That will
make it likely that if you mistakenly continue to use that block,
you will get a crash or misbehavior of some kind.
That's what I do when I compile the interpreter in "DEBUG"
mode. It helps catch certain errors. free() could do it
for you automatically, but it wastes time, so most people wouldn't
like it.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu