Lines Matching refs:bytes
89 znalloc(MemPool *mp, uintptr_t bytes) in znalloc() argument
96 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; in znalloc()
98 if (bytes == 0) in znalloc()
106 if (bytes <= mp->mp_Size - mp->mp_Used) { in znalloc()
111 if (bytes > mn->mr_Bytes) in znalloc()
122 if (mn->mr_Bytes == bytes) { in znalloc()
125 mn = (MemNode *)((char *)mn + bytes); in znalloc()
127 mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; in znalloc()
130 mp->mp_Used += bytes; in znalloc()
148 zfree(MemPool *mp, void *ptr, uintptr_t bytes) in zfree() argument
154 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; in zfree()
156 if (bytes == 0) in zfree()
164 (char *)ptr + bytes > (char *)mp->mp_End || in zfree()
166 panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); in zfree()
176 mp->mp_Used -= bytes; in zfree()
189 if ((char *)ptr + bytes > (char *)mn) { in zfree()
191 (uintmax_t)bytes); in zfree()
198 if ((char *)ptr + bytes == (char *)mn) { in zfree()
200 ((MemNode *)ptr)->mr_Bytes= bytes + mn->mr_Bytes; in zfree()
203 ((MemNode *)ptr)->mr_Bytes= bytes; in zfree()
224 (uintmax_t)bytes); in zfree()
235 ((MemNode *)ptr)->mr_Bytes = bytes; in zfree()
239 ((MemNode *)pmn)->mr_Bytes += bytes; in zfree()
257 zextendPool(MemPool *mp, void *base, uintptr_t bytes) in zextendPool() argument
261 mp->mp_Used = bytes; in zextendPool()
262 mp->mp_End = (char *)base + bytes; in zextendPool()
263 mp->mp_Size = bytes; in zextendPool()
272 base = (char *)base + bytes; in zextendPool()