Re: cache-membuffer.c entry_t
On 23.06.2011 23:24, Daniel Shahaf wrote:
> /* 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.
Received on 2011-06-26 22:37:22 CEST
This is an archived mail posted to the Subversion Dev