FreeBSD/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c
/* Initializes the section of the directory in CACHE that contains
 * the entry group identified by GROUP_INDEX. */
Initializes the section of the directory in CACHE that contains
the entry group identified by GROUP_INDEX.
Initializes the section of the directory in CACHE that contains the entry group identified by GROUP_INDEX .
static void
initialize_group(svn_membuffer_t *cache, apr_uint32_t group_index)
{
  unsigned char bit_mask;
  apr_uint32_t i;
  apr_uint32_t first_index =
      (group_index / GROUP_INIT_GRANULARITY) * GROUP_INIT_GRANULARITY;
  apr_uint32_t last_index = first_index + GROUP_INIT_GRANULARITY;
  if (last_index > cache->group_count + cache->spare_group_count)
    last_index = cache->group_count + cache->spare_group_count;
  for (i = first_index; i < last_index; ++i)
    {
      group_header_t *header = &cache->directory[i].header;
      header->used = 0;
      header->chain_length = 1;
      header->next = NO_INDEX;
      header->previous = NO_INDEX;
    }
  bit_mask
    = (unsigned char)(1 << ((group_index / GROUP_INIT_GRANULARITY) % 8));
  cache->group_initialized[group_index / (8 * GROUP_INIT_GRANULARITY)]
    |= bit_mask;
}
static void initialize_group ( svn_membuffer_t * cache , apr_uint32_t group_index ) { unsigned char bit_mask ; apr_uint32_t i ; apr_uint32_t first_index = ( group_index / GROUP_INIT_GRANULARITY ) * GROUP_INIT_GRANULARITY ; apr_uint32_t last_index = first_index + GROUP_INIT_GRANULARITY ; if ( last_index > cache -> group_count + cache -> spare_group_count ) last_index = cache -> group_count + cache -> spare_group_count ; for ( i = first_index ; i < last_index ; ++ i ) { group_header_t * header = & cache -> directory [ i ] . header ; header -> used = 0 ; header -> chain_length = 1 ; header -> next = NO_INDEX ; header -> previous = NO_INDEX ; } bit_mask = ( unsigned char ) ( 1 << ( ( group_index / GROUP_INIT_GRANULARITY ) % 8 ) ) ; cache -> group_initialized [ group_index / ( 8 * GROUP_INIT_GRANULARITY ) ] |= bit_mask ; }
Initializes the section of the directory in CACHE that contains
 the entry group identified by GROUP_INDEX.
Initializes the section of the directory in CACHE that contains the entry group identified by GROUP_INDEX .
/* range of groups to initialize due to GROUP_INIT_GRANULARITY */ /* set the "initialized" bit for these groups */