Use unwrapped libc malloc/realloc/free by default.
SVN revision: 9492
This commit is contained in:
parent
2b84f92907
commit
7248d27a76
8
src/E.h
8
src/E.h
|
@ -35,6 +35,7 @@
|
|||
#if HAVE_SETENV
|
||||
#define USE_LIBC_SETENV 1 /* Use libc setenv if present */
|
||||
#endif
|
||||
#define USE_LIBC_MALLOC 1 /* Use unwrapped libc malloc/realloc/free */
|
||||
#define DEBUG_EWMH 0
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -2697,10 +2698,11 @@ char CanZoom(void);
|
|||
void ZoomInit(void);
|
||||
void Zoom(EWin * ewin);
|
||||
|
||||
#if defined(USE_LIBC_MALLOC)
|
||||
#if USE_LIBC_MALLOC
|
||||
|
||||
#define Emalloc malloc
|
||||
#define Efree free
|
||||
#define Efree free
|
||||
#define Emalloc malloc
|
||||
#define Erealloc realloc
|
||||
|
||||
#elif defined(__FILE__) && defined(__LINE__)
|
||||
|
||||
|
|
|
@ -4943,7 +4943,9 @@ IPC_Group(const char *params, Client * c)
|
|||
static void
|
||||
IPC_MemDebug(const char *params, Client * c)
|
||||
{
|
||||
#if !USE_LIBC_MALLOC
|
||||
EDisplayMemUse();
|
||||
#endif
|
||||
|
||||
params = NULL;
|
||||
c = NULL;
|
||||
|
|
11
src/memory.c
11
src/memory.c
|
@ -21,6 +21,9 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include <time.h>
|
||||
|
||||
#if !USE_LIBC_MALLOC
|
||||
|
||||
/* uncomment DBUG_MEM to get rudamentary pointer checking */
|
||||
/* uncomment MEM_OUT to get full debug output. to make this work you have to */
|
||||
|
@ -67,7 +70,7 @@ static time_t pointers_time[POINTERS_SIZE];
|
|||
PSTK(y, 20); PSTK(y, 21); PSTK(y, 22); PSTK(y, 23); PSTK(y, 24);\
|
||||
PSTK(y, 25); PSTK(y, 26); PSTK(y, 27); PSTK(y, 28); PSTK(y, 29);\
|
||||
PSTK(y, 30); PSTK(y, 31);\
|
||||
end: \
|
||||
end:; \
|
||||
}
|
||||
|
||||
static struct _symtab
|
||||
|
@ -79,7 +82,7 @@ static struct _symtab
|
|||
|
||||
static int sym_count = 0;
|
||||
|
||||
char *
|
||||
static const char *
|
||||
getsym(void *p)
|
||||
{
|
||||
int i;
|
||||
|
@ -113,7 +116,7 @@ EDisplayMemUse()
|
|||
void *p;
|
||||
char buf[256];
|
||||
|
||||
while (fscanf(f, "%x %*s %250s\n", &p, buf) != EOF)
|
||||
while (fscanf(f, "%p %*s %250s\n", &p, buf) != EOF)
|
||||
{
|
||||
sym_count++;
|
||||
sym = realloc(sym, sizeof(struct _symtab) * sym_count);
|
||||
|
@ -391,6 +394,8 @@ __Efree(void *ptr, const char *file, int line)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* !USE_LIBC_MALLOC */
|
||||
|
||||
#if !USE_LIBC_STRDUP
|
||||
char *
|
||||
Estrdup(const char *s)
|
||||
|
|
Loading…
Reference in New Issue