/* ISC License Copyright (c) 2020, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "extern_c.h" #include #include EXTERN_C_BEGIN void xmem_enable(void); void xmem_disable(void); void *xmem_malloc_(size_t size, const char *file, const int line); void *xmem_realloc_(void *ptr, size_t size, const char *file, const int line); void *xmem_calloc_(size_t nmemb, size_t size, const char *file, const int line); void xmem_free_(void *ptr, const char *file, const int line); char *xmem_strdup_(const char *s, const char *file, const int line); void xmem_print(FILE *file); void xmem_print_to_tmp(void); #define xmem_malloc(SIZE) (xmem_malloc_((SIZE),__FILE__,__LINE__)) #define xmem_realloc(PTR,SIZE) (xmem_realloc_((PTR),(SIZE),__FILE__,__LINE__)) #define xmem_calloc(NMEMB,SIZE) (xmem_calloc_((NMEMB),(SIZE),__FILE__,__LINE__)) #define xmem_free(PTR) (xmem_free_((PTR),__FILE__,__LINE__)) #define xmem_strdup(STR) (xmem_strdup_((STR),__FILE__,__LINE__)) EXTERN_C_END