Lines Matching refs:ptr
352 void *ptr = NULL; in raw_memalign() local
368 ptr = bget(alignment, hdr_size, s, &ctx->poolset); in raw_memalign()
370 raw_malloc_return_hook(ptr, pl_size, ctx); in raw_memalign()
372 return ptr; in raw_memalign()
385 void raw_free(void *ptr, struct malloc_ctx *ctx, bool wipe) in raw_free() argument
389 if (ptr) in raw_free()
390 brel(ptr, &ctx->poolset, wipe); in raw_free()
396 void *ptr = NULL; in raw_calloc() local
411 ptr = bgetz(0, hdr_size, s, &ctx->poolset); in raw_calloc()
413 raw_malloc_return_hook(ptr, pl_nmemb * pl_size, ctx); in raw_calloc()
415 return ptr; in raw_calloc()
418 void *raw_realloc(void *ptr, size_t hdr_size, size_t ftr_size, in raw_realloc() argument
436 p = bgetr(ptr, 0, 0, s, &ctx->poolset); in raw_realloc()
539 static void gen_mdbg_free(struct malloc_ctx *ctx, void *ptr, bool wipe) in gen_mdbg_free() argument
541 struct mdbg_hdr *hdr = ptr; in gen_mdbg_free()
552 static void free_helper(void *ptr, bool wipe) in free_helper() argument
556 gen_mdbg_free(&malloc_ctx, ptr, wipe); in free_helper()
578 int lineno, void *ptr, size_t size) in gen_mdbg_realloc_unlocked() argument
580 struct mdbg_hdr *hdr = ptr; in gen_mdbg_realloc_unlocked()
596 int lineno, void *ptr, size_t size) in gen_mdbg_realloc() argument
601 p = gen_mdbg_realloc_unlocked(ctx, fname, lineno, ptr, size); in gen_mdbg_realloc()
606 #define realloc_unlocked(ctx, ptr, size) \ argument
607 gen_mdbg_realloc_unlocked(ctx, __FILE__, __LINE__, (ptr), (size))
672 void *mdbg_realloc(const char *fname, int lineno, void *ptr, size_t size) in mdbg_realloc() argument
674 return gen_mdbg_realloc(&malloc_ctx, fname, lineno, ptr, size); in mdbg_realloc()
707 void *realloc(void *ptr, size_t size) in realloc() argument
709 return mdbg_realloc(__FILE__, __LINE__, ptr, size); in realloc()
724 static void free_helper(void *ptr, bool wipe) in free_helper() argument
728 raw_free(ptr, &malloc_ctx, wipe); in free_helper()
742 static void *realloc_unlocked(struct malloc_ctx *ctx, void *ptr, in realloc_unlocked() argument
745 return raw_realloc(ptr, 0, 0, size, ctx); in realloc_unlocked()
748 void *realloc(void *ptr, size_t size) in realloc() argument
753 p = realloc_unlocked(&malloc_ctx, ptr, size); in realloc()
768 static void *get_payload_start_size(void *ptr, size_t *size) in get_payload_start_size() argument
770 *size = bget_buf_size(ptr); in get_payload_start_size()
771 return ptr; in get_payload_start_size()
776 void free(void *ptr) in free() argument
778 free_helper(ptr, false); in free()
781 void free_wipe(void *ptr) in free_wipe() argument
783 free_helper(ptr, true); in free_wipe()
956 void *nex_realloc(void *ptr, size_t size) in nex_realloc() argument
961 p = realloc_unlocked(&nex_malloc_ctx, ptr, size); in nex_realloc()
976 void nex_free(void *ptr) in nex_free() argument
980 raw_free(ptr, &nex_malloc_ctx, false /* !wipe */); in nex_free()
996 void *nex_mdbg_realloc(const char *fname, int lineno, void *ptr, size_t size) in nex_mdbg_realloc() argument
998 return gen_mdbg_realloc(&nex_malloc_ctx, fname, lineno, ptr, size); in nex_mdbg_realloc()
1012 void nex_free(void *ptr) in nex_free() argument
1016 gen_mdbg_free(&nex_malloc_ctx, ptr, false /* !wipe */); in nex_free()