Lines Matching refs:nbytes
63 mdb_umem_handler(size_t nbytes, size_t align, uint_t flags)
77 (ulong_t)nbytes);
96 (ulong_t)nbytes);
104 ptr = memalign(align, nbytes);
106 ptr = malloc(nbytes);
126 die("failed to allocate %lu bytes -- terminating\n", (ulong_t)nbytes);
134 mdb_umem_gc_enter(void *ptr, size_t nbytes)
139 blkp->blk_size = nbytes;
167 mdb_alloc_align(size_t nbytes, size_t align, uint_t flags)
170 size_t obytes = nbytes;
172 if (nbytes == 0 || nbytes > MDB_ALLOC_MAX)
175 nbytes = (nbytes + sizeof (uint32_t) - 1) & ~(sizeof (uint32_t) - 1);
176 if (nbytes < obytes || nbytes == 0)
180 ptr = memalign(align, nbytes);
182 ptr = malloc(nbytes);
186 ptr = mdb_umem_handler(nbytes, align, flags);
190 mdb_umem_copy_pattern(UMEM_UNINITIALIZED_PATTERN, ptr, nbytes);
193 mdb_umem_gc_enter(ptr, nbytes);
199 mdb_alloc(size_t nbytes, uint_t flags)
201 return (mdb_alloc_align(nbytes, 0, flags));
205 mdb_zalloc(size_t nbytes, uint_t flags)
207 void *ptr = mdb_alloc(nbytes, flags);
210 bzero(ptr, nbytes);
216 mdb_free(void *ptr, size_t nbytes)
218 ASSERT(ptr != NULL || nbytes == 0);
220 nbytes = (nbytes + sizeof (uint32_t) - 1) & ~(sizeof (uint32_t) - 1);
224 mdb_umem_copy_pattern(UMEM_FREE_PATTERN, ptr, nbytes);
230 mdb_free_align(void *ptr, size_t nbytes)
232 mdb_free(ptr, nbytes);