Lines Matching refs:bytes
80 znalloc(MemPool *mp, uintptr_t bytes) in znalloc() argument
87 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; in znalloc()
89 if (bytes == 0) in znalloc()
97 if (bytes <= mp->mp_Size - mp->mp_Used) { in znalloc()
102 if (bytes > mn->mr_Bytes) in znalloc()
113 if (mn->mr_Bytes == bytes) { in znalloc()
116 mn = (MemNode *)((char *)mn + bytes); in znalloc()
118 mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; in znalloc()
121 mp->mp_Used += bytes; in znalloc()
139 zfree(MemPool *mp, void *ptr, uintptr_t bytes) in zfree() argument
145 bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; in zfree()
147 if (bytes == 0) in zfree()
155 (char *)ptr + bytes > (char *)mp->mp_End || in zfree()
157 panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); in zfree()
167 mp->mp_Used -= bytes; in zfree()
180 if ((char *)ptr + bytes > (char *)mn) { in zfree()
182 (uintmax_t)bytes); in zfree()
189 if ((char *)ptr + bytes == (char *)mn) { in zfree()
191 ((MemNode *)ptr)->mr_Bytes= bytes + mn->mr_Bytes; in zfree()
194 ((MemNode *)ptr)->mr_Bytes= bytes; in zfree()
215 (uintmax_t)bytes); in zfree()
226 ((MemNode *)ptr)->mr_Bytes = bytes; in zfree()
230 ((MemNode *)pmn)->mr_Bytes += bytes; in zfree()
248 zextendPool(MemPool *mp, void *base, uintptr_t bytes) in zextendPool() argument
252 mp->mp_Used = bytes; in zextendPool()
253 mp->mp_End = (char *)base + bytes; in zextendPool()
254 mp->mp_Size = bytes; in zextendPool()
263 base = (char *)base + bytes; in zextendPool()