Re: Global variables lifetime
| From: | Piotr Pokora | Date: | Tue, 09 Dec 2008 12:06:25 +0000 |
| Subject: | Re: Global variables lifetime | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-5979@lists.php.net to get a copy of this message | ||
Alexey Zakhlestin writes:
>> How is the variable lifetime ? Precisely the variable should be used at
>> webserver startup and still using it until shutdown without lose any data
>> and this should be done in any webserver and plataform (Apache, IIS etc) ???
>>
>> Explanations will be very appreciated.
>
> As long, as you use malloc() to allocate memory, it will not be
> gathered by garbage collector, so it's lifetime is defined by you.
Shouldn't be also done in MINIT phase?
I am just curious, cause I noticed weird dtor segfaults when malloced
anything in RINIT.
Piotras