Commits

gustafn committed d8c8a39

Add preprocessor flag to use system malloc directly (needs as well SYSTEM_MALLOC for Tcl)

Comments (0)

Files changed (1)

nsthread/memory.c

  *
  *----------------------------------------------------------------------
  */
+#define SYSTEM_MALLOC 0
 
+#if defined(SYSTEM_MALLOC)
+void *ns_realloc(void *ptr, size_t size)  { return realloc(ptr, size); }
+void *ns_malloc(size_t size)              { return malloc(size); }
+void ns_free(void *ptr)                   { /*fprintf(stderr, "free %p\n", ptr); if (ptr) */ {free(ptr);} }
+void *ns_calloc(size_t num, size_t esize) { return calloc(num, esize); }
+#else
 void *
 ns_realloc(void *ptr, size_t size)
 {
 
     return new;
 }
+#endif
 
 char *
 ns_strcopy(const char *old)