[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: cache-membuffer.c entry_t

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Sun, 26 Jun 2011 22:36:43 +0200

On 23.06.2011 23:24, Daniel Shahaf wrote:
> Stefan,
>
> [[[
> /* A single dictionary entry. Since they are allocated statically, these
> * entries can either be in use or in used state. An entry is unused, iff
> * the offset member is NO_OFFSET. In that case, it must not be linked in
> * the list of used entries.
> */
> typedef struct entry_t
> ]]]
>
> First, could you please clarify "either be in use or in used state"?
>
> Second, as far as I can see, the allocation is done via dynamically allocating
> GROUP_COUNT groups (where each group contains GROUP_SIZE entry_t's):
>
> c[seg].directory = apr_pcalloc(pool,
> group_count * sizeof(entry_group_t));
>
> So, not really 'statically allocated' in the common sense of the phrase.
> It does mean that all entry_t's are allocated once-per-cache-lifetime,
> though (and in particular are allocated before their use).
>
> Would it be more accurate to change the docstring to:
>
> /* A single dictionary entry. Since they are allocated ahead of time, allocated
> * entries might be either used or unused. An entry is used if and only if it
> * is contained in the doubly-linked list of entries. An entry is unused if
> * and only if its OFFSET member is NO_OFFSET.
> */
>
> ?
>
Commited as r1139936 with a minor tweak to the
"ahead of time" part.

-- Stefan^2.
Received on 2011-06-26 22:37:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.