Lines Matching refs:hdr
256 static void *postred_ptr(struct block_hdr *hdr)
260 ptr = (uintptr_t) hdr + hdr->size - sizeof(unsigned int);
266 static void fill_redzone(struct block_hdr *hdr)
268 unsigned int *postred = postred_ptr(hdr);
270 hdr->prered = SMALLOC_PRE_RED;
274 static void sfree_check_redzone(struct block_hdr *hdr)
276 unsigned int *postred = postred_ptr(hdr);
278 if (hdr->prered != SMALLOC_PRE_RED) {
281 hdr, hdr->prered, SMALLOC_PRE_RED);
287 hdr, *postred, SMALLOC_POST_RED);
292 static void fill_redzone(struct block_hdr *hdr)
296 static void sfree_check_redzone(struct block_hdr *hdr)
303 struct block_hdr *hdr;
310 ptr -= sizeof(*hdr);
311 hdr = ptr;
315 sfree_check_redzone(hdr);
322 clear_blocks(pool, i, idx, size_to_blocks(hdr->size));
325 pool->free_blocks += size_to_blocks(hdr->size);
423 struct block_hdr *hdr = ptr;
425 hdr->size = alloc_size;
426 fill_redzone(hdr);
428 ptr += sizeof(*hdr);