Lines Matching refs:bytes
67 * Allocation and frees of 0 bytes are valid operations.
88 znalloc(MemPool *mp, uintptr_t bytes, size_t align)
98 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK;
100 if (bytes == 0)
108 if (bytes > mp->mp_Size - mp->mp_Used)
121 if (bytes + extra > mn->mr_Bytes)
148 if (mn->mr_Bytes == bytes) {
151 mn = (MemNode *)((char *)mn + bytes);
153 mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes;
156 mp->mp_Used += bytes;
172 zfree(MemPool *mp, void *ptr, uintptr_t bytes)
181 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK;
183 if (bytes == 0)
191 (char *)ptr + bytes > (char *)mp->mp_End ||
193 panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes);
198 mp->mp_Used -= bytes;
211 if ((char *)ptr + bytes > (char *)mn) {
213 (uintmax_t)bytes);
220 if ((char *)ptr + bytes == (char *)mn) {
223 bytes + mn->mr_Bytes;
226 ((MemNode *)ptr)->mr_Bytes = bytes;
248 (uintmax_t)bytes);
258 ((MemNode *)ptr)->mr_Bytes = bytes;
262 ((MemNode *)pmn)->mr_Bytes += bytes;
279 zextendPool(MemPool *mp, void *base, uintptr_t bytes)
283 mp->mp_Used = bytes;
284 mp->mp_End = (char *)base + bytes;
285 mp->mp_Size = bytes;
294 base = (char *)base + bytes;
313 printf("%d bytes reserved", (int)mp->mp_Size);
332 printf(" %d bytes allocated\n%d fragments (%d bytes fragmented)\n",