Lines Matching refs:size

70 	size_t			size;
180 __memget(size_t size) {
181 return (__memget_record(size, NULL, 0));
185 __memget_record(size_t size, const char *file, int line) {
186 size_t new_size = quantize(size);
206 if (size == 0U) {
211 if (size >= max_size || new_size >= max_size) {
223 e->size = size;
232 p = (char *)e + sizeof *e + size;
237 return (malloc(size));
242 * If there are no blocks in the free list for this size, get a chunk
292 /* Set up a linked-list of blocks of size "new_size". */
311 /* The free list uses the "rounded-up" size "new_size". */
322 memset(ret, 0xe5, size);
329 e->size = size;
334 e->next = activelists[size];
335 activelists[size] = e;
337 p = (char *)e + sizeof *e + size;
342 * The stats[] uses the _actual_ "size" requested by the
343 * caller, with the caveat (in the code above) that "size" >= the
344 * max. size (max_size) ends up getting recorded as a call to
347 stats[size].gets++;
348 stats[size].totalgets++;
363 __memput(void *mem, size_t size) {
364 __memput_record(mem, size, NULL, 0);
368 __memput_record(void *mem, size_t size, const char *file, int line) {
369 size_t new_size = quantize(size);
389 if (size == 0U) {
398 INSIST(e->size == size);
399 p = (char *)e + sizeof *e + size;
405 if (size == max_size || new_size >= max_size)
408 el = activelists[size];
415 if (size == max_size || new_size >= max_size)
418 activelists[size] = el->next;
424 if (size == max_size || new_size >= max_size) {
438 /* The free list uses the "rounded-up" size "new_size": */
441 e->size = 0; /*%< catch double memput() */
465 * The stats[] uses the _actual_ "size" requested by the
466 * caller, with the caveat (in the code above) that "size" >= the
467 * max. size (max_size) ends up getting recorded as a call to
470 INSIST(stats[size].gets != 0U);
471 stats[size].gets--;
477 __memget_debug(size_t size, const char *file, int line) {
479 ptr = __memget_record(size, file, line);
481 (u_long)size, ptr);
486 __memput_debug(void *ptr, size_t size, const char *file, int line) {
488 (u_long)size);
489 __memput_record(ptr, size, file, line);
530 (u_long)e->size);
553 * Round up size to a multiple of sizeof(void *). This guarantees that a
558 quantize(size_t size) {
565 * then we already have a good size; if not, then we need
566 * to round up the result in order to get a size big
569 remainder = size % P_SIZE;
571 size += P_SIZE - remainder;
573 return (size + SMALL_SIZE_LIMIT + sizeof (int));
575 return (size);