Lines Matching refs:nbytes

123 void		kmem_free(void *ptr, size_t nbytes);
150 size_t nbytes;
441 kmem_alloc(size_t nbytes, int kmflag)
452 printf("kmem_alloc(nbytes 0x%lx)\n", nbytes);
455 if (nbytes == 0) {
460 if (nbytes < SMALLEST_BLK) {
461 printf("illegal kmem_alloc call for %lx bytes\n", nbytes);
471 if (mweight(kmem_info.free_root) <= nbytes) {
475 if (!morecore(nbytes)) {
476 printf("kmem_alloc failed, nbytes %lx\n", nbytes);
494 while (left_weight >= nbytes || right_weight >= nbytes) {
496 if (left_weight >= nbytes) {
504 if (right_weight >= nbytes) {
522 if (a->size - nbytes < SMALLEST_BLK) {
532 * split the node, allocating nbytes from the top.
542 size = nbytes + ALIGNMORE(a->block->data);
561 x->block = nextblk(a->block, nbytes);
562 x->size = a->size - nbytes;
581 bzero(retblock, nbytes);
602 kmem_free(void *ptr, size_t nbytes)
611 printf("kmem_free (ptr %p nbytes %lx)\n", ptr, nbytes);
616 neigh_block = bkmem_zalloc(nbytes);
619 if (nbytes == 0) {
638 if ((char *)ptr + nbytes == neigh_block) {
642 nbytes += neigh_size;
644 } else if ((char *)ptr + nbytes > neigh_block) {
651 " over %p\n", (void *)ptr, nbytes,
666 nbytes += neigh_size;
693 insert((Dblk) ptr, nbytes, &kmem_info.free_root);
734 size_t nbytes;
742 nbytes = ntf->nbytes;
745 kmem_free(addr, nbytes);
752 nbytes = ntf[i].nbytes;
755 kmem_free(addr, nbytes);
763 * Add a block of at least nbytes to the free space tree.
766 * true if at least nbytes can be allocated
771 * extended by an amount determined by rounding nbytes up to
776 morecore(size_t nbytes)
785 printf("morecore(nbytes 0x%lx)\n", nbytes);
789 nbytes = roundup(nbytes, PAGESIZE);
790 p = (Dblk) resalloc(type, nbytes, (caddr_t)0, 0);
794 kmem_free((caddr_t)p, nbytes);