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

cache-membuffer.c entry_t

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Fri, 24 Jun 2011 00:24:08 +0300

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.
 */

?

Thanks,

Daniel
Received on 2011-06-23 23:25:03 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.