David Glasser wrote:
> On Mon, May 26, 2008 at 6:53 PM, Troy Curtis Jr <troycurtisjr_at_gmail.com> wrote:
>> On Mon, May 26, 2008 at 4:22 PM, Karl Fogel <kfogel_at_red-bean.com> wrote:
>>> "Troy Curtis Jr" <troycurtisjr_at_gmail.com> writes:
>>>> + *peg_revision = apr_pstrdup(pool, "");
>>>> + }
>>>> +
>>>> + return SVN_NO_ERROR;
>>>> +}
>>> No need to strdup "" into a pool. Just assign "" directly; the static
>>> storage won't hurt anyone, will it?
>>>
>> Ok, I'm still trying to get used to all this pool based things. The
>> static storage is OK here because the string is never explicitly freed
>> by the caller, just the pool is freed at some point in the future. Do
>> I understand that correctly?
>
> Since "" is a constant, it almost certainly will be compiled as a
> pointer to a fixed copy of the empty string in the program's text: no
> dynamic allocation or freeing involved at all.
Is it possible that the DLL containing the code is unloaded
before the pool is destroyed?
Folker
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-27 07:55:28 CEST