X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/ec1a68c8a2703555659265994f30e8f9156af21c..51db18e02060ffaee80af608346df7bf66007e8e:/src/common.h diff --git a/src/common.h b/src/common.h index cd4bb62..e9e5c0e 100644 --- a/src/common.h +++ b/src/common.h @@ -1,7 +1,7 @@ /* common.h - Common functions/includes * Copyright 2000-2004 srvx Development Team * - * This file is part of srvx. + * This file is part of x3. * * srvx is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,6 +102,24 @@ extern void srvx_free(const char *, unsigned int, void *); extern void verify(const void *ptr); # define verify(x) verify(x) # endif +#elif defined(WITH_MALLOC_SLAB) +# define malloc(n) slab_malloc(__FILE__, __LINE__, (n)) +# undef calloc +# define calloc(m,n) slab_malloc(__FILE__, __LINE__, (m)*(n)) +# undef realloc +# define realloc(p,n) slab_realloc(__FILE__, __LINE__, (p), (n)) +# undef free +# define free(p) slab_free(__FILE__, __LINE__, (p)) +# undef strdup +# define strdup(s) slab_strdup(__FILE__, __LINE__, (s)) +extern void *slab_malloc(const char *, unsigned int, size_t); +extern void *slab_realloc(const char *, unsigned int, void *, size_t); +extern char *slab_strdup(const char *, unsigned int, const char *); +extern void slab_free(const char *, unsigned int, void *); +# if !defined(NDEBUG) +extern void verify(const void *ptr); +# define verify(x) verify(x) +# endif #endif #ifndef verify