FreeBSD/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c
/* Insert ENTRY into the chain of used dictionary entries. The entry's
 * offset and size members must already have been initialized. Also,
 * the offset must match the beginning of the insertion window.
 */
Insert ENTRY into the chain of used dictionary entries. The entry's
offset and size members must already have been initialized. Also,
the offset must match the beginning of the insertion window.
Insert ENTRY into the chain of used dictionary entries . The entry ' s offset and size members must already have been initialized . Also the offset must match the beginning of the insertion window .
static void
insert_entry(svn_membuffer_t *cache, entry_t *entry)
{
  apr_uint32_t idx = get_index(cache, entry);
  apr_uint32_t group_index = idx / GROUP_SIZE;
  entry_group_t *group = &cache->directory[group_index];
  cache_level_t *level = get_cache_level(cache, entry);
  assert(entry->offset == level->current_data);
  assert(idx == group_index * GROUP_SIZE + group->header.used);
  level->current_data = ALIGN_VALUE(entry->offset + entry->size);
  cache->used_entries++;
  cache->data_used += entry->size;
  entry->hit_count = 0;
  group->header.used++;
  chain_entry(cache, level, entry, idx);
  assert(level->current_data <= level->start_offset + level->size);
}
static void insert_entry ( svn_membuffer_t * cache , entry_t * entry ) { apr_uint32_t idx = get_index ( cache , entry ) ; apr_uint32_t group_index = idx / GROUP_SIZE ; entry_group_t * group = & cache -> directory [ group_index ] ; cache_level_t * level = get_cache_level ( cache , entry ) ; assert ( entry -> offset == level -> current_data ) ; assert ( idx == group_index * GROUP_SIZE + group -> header . used ) ; level -> current_data = ALIGN_VALUE ( entry -> offset + entry -> size ) ; cache -> used_entries ++ ; cache -> data_used += entry -> size ; entry -> hit_count = 0 ; group -> header . used ++ ; chain_entry ( cache , level , entry , idx ) ; assert ( level -> current_data <= level -> start_offset + level -> size ) ; }
Insert ENTRY into the chain of used dictionary entries.
Insert ENTRY into the chain of used dictionary entries .
/* the group that ENTRY belongs to plus a number of useful index values
   */ /* The entry must start at the beginning of the insertion window.
   * It must also be the first unused entry in the group.
   */ /* update usage counters
   */ /* update entry chain
   */ /* The current insertion position must never point outside our
   * data buffer.
   */