Lines Matching refs:nbytes

121 void		kmem_free(void *ptr, size_t nbytes);
148 size_t nbytes; member
439 kmem_alloc(size_t nbytes, int kmflag) in kmem_alloc() argument
450 printf("kmem_alloc(nbytes 0x%lx)\n", nbytes); in kmem_alloc()
453 if (nbytes == 0) { in kmem_alloc()
458 if (nbytes < SMALLEST_BLK) { in kmem_alloc()
459 printf("illegal kmem_alloc call for %lx bytes\n", nbytes); in kmem_alloc()
469 if (mweight(kmem_info.free_root) <= nbytes) { in kmem_alloc()
473 if (!morecore(nbytes)) { in kmem_alloc()
474 printf("kmem_alloc failed, nbytes %lx\n", nbytes); in kmem_alloc()
492 while (left_weight >= nbytes || right_weight >= nbytes) { in kmem_alloc()
494 if (left_weight >= nbytes) { in kmem_alloc()
502 if (right_weight >= nbytes) { in kmem_alloc()
520 if (a->size - nbytes < SMALLEST_BLK) { in kmem_alloc()
540 size = nbytes + ALIGNMORE(a->block->data); in kmem_alloc()
559 x->block = nextblk(a->block, nbytes); in kmem_alloc()
560 x->size = a->size - nbytes; in kmem_alloc()
579 bzero(retblock, nbytes); in kmem_alloc()
600 kmem_free(void *ptr, size_t nbytes) in kmem_free() argument
609 printf("kmem_free (ptr %p nbytes %lx)\n", ptr, nbytes); in kmem_free()
614 neigh_block = bkmem_zalloc(nbytes); in kmem_free()
617 if (nbytes == 0) { in kmem_free()
636 if ((char *)ptr + nbytes == neigh_block) { in kmem_free()
640 nbytes += neigh_size; in kmem_free()
642 } else if ((char *)ptr + nbytes > neigh_block) { in kmem_free()
649 " over %p\n", (void *)ptr, nbytes, in kmem_free()
664 nbytes += neigh_size; in kmem_free()
690 insert((Dblk) ptr, nbytes, &kmem_info.free_root); in kmem_free()
731 size_t nbytes; in check_need_to_free() local
739 nbytes = ntf->nbytes; in check_need_to_free()
742 kmem_free(addr, nbytes); in check_need_to_free()
749 nbytes = ntf[i].nbytes; in check_need_to_free()
752 kmem_free(addr, nbytes); in check_need_to_free()
773 morecore(size_t nbytes) in morecore() argument
782 printf("morecore(nbytes 0x%lx)\n", nbytes); in morecore()
786 nbytes = roundup(nbytes, PAGESIZE); in morecore()
787 p = (Dblk) resalloc(type, nbytes, (caddr_t)0, 0); in morecore()
791 kmem_free((caddr_t)p, nbytes); in morecore()