FreeBSD/contrib/ntp/ntpq/ntpq.c
/*
 * grow_assoc_cache() - enlarge dynamic assoc_cache array
 *
 * The strategy is to add an assumed 4k page size at a time, leaving
 * room for malloc() bookkeeping overhead equivalent to 4 pointers.
 */
enlarge dynamic assoc_cache array
The strategy is to add an assumed 4k page size at a time, leaving
room for malloc() bookkeeping overhead equivalent to 4 pointers.
enlarge dynamic assoc_cache array The strategy is to add an assumed 4k page size at a time leaving room for malloc () bookkeeping overhead equivalent to 4 pointers .
void
grow_assoc_cache(void)
{
	static size_t	prior_sz;
	size_t		new_sz;
	new_sz = prior_sz + 4 * 1024;
	if (0 == prior_sz) {
		new_sz -= 4 * sizeof(void *);
	}
	assoc_cache = erealloc_zero(assoc_cache, new_sz, prior_sz); 
	prior_sz = new_sz;
	assoc_cache_slots = (u_int)(new_sz / sizeof(assoc_cache[0]));
}
void grow_assoc_cache ( void ) { static size_t prior_sz ; size_t new_sz ; new_sz = prior_sz + 4 * 1024 ; if ( 0 == prior_sz ) { new_sz -= 4 * sizeof ( void * ) ; } assoc_cache = erealloc_zero ( assoc_cache , new_sz , prior_sz ) ; prior_sz = new_sz ; assoc_cache_slots = ( u_int ) ( new_sz / sizeof ( assoc_cache [ 0 ] ) ) ; }
grow_assoc_cache() - enlarge dynamic assoc_cache array
 The strategy is to add an assumed 4k page size at a time, leaving
 room for malloc() bookkeeping overhead equivalent to 4 pointers.
grow_assoc_cache () - enlarge dynamic assoc_cache array The strategy is to add an assumed 4k page size at a time leaving room for malloc () bookkeeping overhead equivalent to 4 pointers .