Ecere SDK/eC Forums http://ec-lang.org/community/ Print view |
|
Does the renew operator delete the previously allocated mem? http://ec-lang.org/community/viewtopic.php?f=1&t=63 |
Page 1 of 1 |
Author: | fedor_bel [ Wed Mar 31, 2010 8:55 am ] |
Post subject: | Does the renew operator delete the previously allocated mem? |
Hello, Does the renew operator delete the previously allocated memory? Like if some memory was allocated with new and then I call the renew operator and a completely new block of memory will be allocated, will the old block be freed? Hopefully it will. |
Author: | jerome [ Wed Mar 31, 2010 8:57 am ] |
Post subject: | Re: Does the renew operator delete the previously allocated mem? |
Hi fedor. Yes the renew allocator either reuses, or frees then allocates a new block of memory. It works similarly to the C function 'realloc'. Typical usage: Code: Select all
Also note the zeroing versions: Code: Select all
|
All times are UTC-05:00 | Page 1 of 1 |
Powered by phpBB® Forum Software © phpBB Limited |