Re: LCCWIN ver WATCOM, BORLAND and interpreter

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

Euman writes:
> ...Now you are actually free'ing the right address for iChild
>
> Why is it that Borland and the interpreter didnt catch this?

Euphoria's free() calls C's free().
Euphoria's allocate() calls C's malloc().

Each C compiler implements malloc() and free() differently.

I believe Watcom's free() just sets a bit saying "this block is free".
Joining together of adjacent free blocks is done later when malloc()
searches for a free block. So the crash may come much later
in your program, if at all, and for no apparent reason.

Other compilers do the joining together part immediately, 
during the free() itself. This makes it more likely that a crash 
will occur right away.

If you are using only allocate() and free(),
euphoria\include\safe.e can sometimes 
be used to catch the case where you free an address
that you didn't allocate.

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