FreeBSD/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c
/* Add statistics of SEGMENT to INFO.  If INCLUDE_HISTOGRAM is TRUE,
 * accumulate index bucket fill levels in INFO->HISTOGRAM.
 */
Add statistics of SEGMENT to INFO.  If INCLUDE_HISTOGRAM is TRUE,
accumulate index bucket fill levels in INFO->HISTOGRAM.
Add statistics of SEGMENT to INFO . If INCLUDE_HISTOGRAM is TRUE accumulate index bucket fill levels in INFO - > HISTOGRAM .
static svn_error_t *
svn_membuffer_get_segment_info(svn_membuffer_t *segment,
                               svn_cache__info_t *info,
                               svn_boolean_t include_histogram)
{
  apr_uint32_t i;
  info->data_size += segment->l1.size + segment->l2.size;
  info->used_size += segment->data_used;
  info->total_size += segment->l1.size + segment->l2.size +
      segment->group_count * GROUP_SIZE * sizeof(entry_t);
  info->used_entries += segment->used_entries;
  info->total_entries += segment->group_count * GROUP_SIZE;
  if (include_histogram)
    for (i = 0; i < segment->group_count; ++i)
      if (is_group_initialized(segment, i))
        {
          entry_group_t *chain_end
            = last_group_in_chain(segment, &segment->directory[i]);
          apr_size_t use
            = MIN(chain_end->header.used,
                  sizeof(info->histogram) / sizeof(info->histogram[0]) - 1);
          info->histogram[use]++;
        }
  return SVN_NO_ERROR;
}
static svn_error_t * svn_membuffer_get_segment_info ( svn_membuffer_t * segment , svn_cache__info_t * info , svn_boolean_t include_histogram ) { apr_uint32_t i ; info -> data_size += segment -> l1 . size + segment -> l2 . size ; info -> used_size += segment -> data_used ; info -> total_size += segment -> l1 . size + segment -> l2 . size + segment -> group_count * GROUP_SIZE * sizeof ( entry_t ) ; info -> used_entries += segment -> used_entries ; info -> total_entries += segment -> group_count * GROUP_SIZE ; if ( include_histogram ) for ( i = 0 ; i < segment -> group_count ; ++ i ) if ( is_group_initialized ( segment , i ) ) { entry_group_t * chain_end = last_group_in_chain ( segment , & segment -> directory [ i ] ) ; apr_size_t use = MIN ( chain_end -> header . used , sizeof ( info -> histogram ) / sizeof ( info -> histogram [ 0 ] ) - 1 ) ; info -> histogram [ use ] ++ ; } return SVN_NO_ERROR ; }
Add statistics of SEGMENT to INFO.
Add statistics of SEGMENT to INFO .