Question about emalloc
| From: | Mikey | Date: | Wed, 16 Oct 2002 23:58:23 +0000 |
| Subject: | Question about emalloc | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-16422@lists.php.net to get a copy of this message | ||
Not too sure if I am in the right place, but here goes...
I am working on writing my own module and so far seem to be doing OK, but I
have one quick question. In the Memory Management section of the manual
(Ch. 26) it says:
"emalloc(), estrdup(), estrndup(), ecalloc(), and erealloc() allocate
internal memory; efree() frees these previously allocated blocks. Memory
handled by the e*() functions is considered local to the current process and
is discarded as soon as the script executed by this process is terminated."
Does this mean that I can emalloc a string and not have to worry about
efree()'ing it at the end? Also, if it is local to the process, how can it
be used to pass values out of a function?
regards,
Mikey
"If you give someone a program, you will frustrate them for a day. If you
teach them how to program, you will frustrate them for a lifetime."