FreeBSD/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c
/* Move a surviving ENTRY from just behind the insertion window to
 * its beginning and move the insertion window up accordingly.
 */
Move a surviving ENTRY from just behind the insertion window to
its beginning and move the insertion window up accordingly.
Move a surviving ENTRY from just behind the insertion window to its beginning and move the insertion window up accordingly .
static void
move_entry(svn_membuffer_t *cache, entry_t *entry)
{
  apr_size_t size = ALIGN_VALUE(entry->size);
  cache_level_t *level = get_cache_level(cache, entry);
  let_entry_age(cache, entry);
  if (entry->offset != level->current_data)
    {
      memmove(cache->data + level->current_data,
              cache->data + entry->offset,
              size);
      entry->offset = level->current_data;
    }
  level->current_data = entry->offset + size;
  level->next = entry->next;
  assert(level->current_data <= level->start_offset + level->size);
}
static void move_entry ( svn_membuffer_t * cache , entry_t * entry ) { apr_size_t size = ALIGN_VALUE ( entry -> size ) ; cache_level_t * level = get_cache_level ( cache , entry ) ; let_entry_age ( cache , entry ) ; if ( entry -> offset != level -> current_data ) { memmove ( cache -> data + level -> current_data , cache -> data + entry -> offset , size ) ; entry -> offset = level -> current_data ; } level -> current_data = entry -> offset + size ; level -> next = entry -> next ; assert ( level -> current_data <= level -> start_offset + level -> size ) ; }
Move a surviving ENTRY from just behind the insertion window to
 its beginning and move the insertion window up accordingly.
Move a surviving ENTRY from just behind the insertion window to its beginning and move the insertion window up accordingly .
/* This entry survived this cleansing run. Reset half of its
   * hit count so that its removal gets more likely in the next
   * run unless someone read / hit this entry in the meantime.
   */ /* Move the entry to the start of the empty / insertion section
   * (if it isn't there already). Size-aligned moves are legal
   * since all offsets and block sizes share this same alignment.
   * Size-aligned moves tend to be faster than non-aligned ones
   * because no "odd" bytes at the end need to special treatment.
   */ /* The insertion position is now directly behind this entry.
   */ /* The current insertion position must never point outside our
   * data buffer.
   */