Lines Matching defs:bytes
68 * Allocation and frees of 0 bytes are valid operations.
89 znalloc(MemPool *mp, uintptr_t bytes)
96 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK;
98 if (bytes == 0)
106 if (bytes <= mp->mp_Size - mp->mp_Used) {
111 if (bytes > mn->mr_Bytes)
122 if (mn->mr_Bytes == bytes) {
125 mn = (MemNode *)((char *)mn + bytes);
127 mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes;
130 mp->mp_Used += bytes;
148 zfree(MemPool *mp, void *ptr, uintptr_t bytes)
154 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK;
156 if (bytes == 0)
164 (char *)ptr + bytes > (char *)mp->mp_End ||
166 panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes);
176 mp->mp_Used -= bytes;
189 if ((char *)ptr + bytes > (char *)mn) {
191 (uintmax_t)bytes);
198 if ((char *)ptr + bytes == (char *)mn) {
200 ((MemNode *)ptr)->mr_Bytes= bytes + mn->mr_Bytes;
203 ((MemNode *)ptr)->mr_Bytes= bytes;
224 (uintmax_t)bytes);
235 ((MemNode *)ptr)->mr_Bytes = bytes;
239 ((MemNode *)pmn)->mr_Bytes += bytes;
257 zextendPool(MemPool *mp, void *base, uintptr_t bytes)
261 mp->mp_Used = bytes;
262 mp->mp_End = (char *)base + bytes;
263 mp->mp_Size = bytes;
272 base = (char *)base + bytes;
291 printf("%d bytes reserved", (int) mp->mp_Size);
308 printf(" %d bytes allocated\n%d fragments (%d bytes fragmented)\n",