From: Sandro Santilli Date: Fri, 8 Oct 2004 13:16:58 +0000 (+0000) Subject: added memory allocation debugging X-Git-Tag: pgis_1_0_0RC1~312 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26e083d39f99e68293aee1a04ae58003958fdc8b;p=postgis added memory allocation debugging git-svn-id: http://svn.osgeo.org/postgis/trunk@966 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/liblwgeom.c b/lwgeom/liblwgeom.c index 948042ef2..db91d7894 100644 --- a/lwgeom/liblwgeom.c +++ b/lwgeom/liblwgeom.c @@ -5,6 +5,7 @@ #define CONTEXT_PG 0 #define CONTEXT_SA 1 + #ifdef STANDALONE #define DEFAULT_CONTEXT CONTEXT_SA #else @@ -115,7 +116,13 @@ lwgeom_typename(int type) void * lwalloc(size_t size) { +#ifdef DEBUG_ALLOCS + void *mem = lwalloc_var(size); + lwnotice("lwalloc: %d@%p", size, mem); + return mem; +#else // ! DEBUG_ALLOCS return lwalloc_var(size); +#endif } void *