X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fxmalloc.h;h=9d4048c1d62f53db69d66b334762dae15e6988d4;hb=2dae06da2dab643f8420fb808cbba7c07a357b55;hp=4ddc4d7f3cc80928beb90fd6e2c8cc2bb82b3c0d;hpb=14fc50785ca534511c6e34a469d84788e7598e87;p=libfirm diff --git a/ir/adt/xmalloc.h b/ir/adt/xmalloc.h index 4ddc4d7f3..9d4048c1d 100644 --- a/ir/adt/xmalloc.h +++ b/ir/adt/xmalloc.h @@ -14,41 +14,17 @@ #ifndef _XMALLOC_H_ #define _XMALLOC_H_ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include -#ifdef HAVE_ALLOCA_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif +/* xmalloc() & friends. */ -#include "host.h" +void *xmalloc(size_t size); +void *xcalloc(size_t num, size_t size); +void *xrealloc(void *ptr, size_t size); +char *xstrdup(const char *str); +void xnomem(void); +void free(void *ptr); -/* xmalloc() & friends. - - The macros set tmalloc_tag to __FILE__, the functions leave it - alone. Use the latter if you set it yourself. See tmalloc.c for - details. */ - -extern void *xmalloc (size_t); -extern void *xrealloc (void *, size_t); -extern char *xstrdup (const char *); -extern void xnomem (void); -extern void free (void *); - -# define xmalloc(size) (XMALLOC_TRACE (xmalloc) ((size))) -# define xrealloc(ptr, size) (XMALLOC_TRACE (xrealloc) ((ptr), (size))) -# define xstrdup(str) (XMALLOC_TRACE (xstrdup) ((str))) -# define xfree(ptr) (XMALLOC_TRACE free ((ptr))) - -#if defined(HAVE_GNU_MALLOC) && defined(DEBUG) -extern const char *tmalloc_tag; -# define XMALLOC_TRACE tmalloc_tag = __FILE__, -#else -# define XMALLOC_TRACE -#endif +#define xfree(ptr) free(ptr) #endif /* _XMALLOC_H_ */