]> git.eshelyaron.com Git - emacs.git/commitdiff
(_malloc_internal) [GC_MALLOC_CHECK]: Use
authorGerd Moellmann <gerd@gnu.org>
Fri, 20 Oct 2000 15:57:00 +0000 (15:57 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 20 Oct 2000 15:57:00 +0000 (15:57 +0000)
_malloc_internal instead of malloc.
(_free_internal) [GC_MALLOC_CHECK]: Use _free_internal instead
of free.

src/ChangeLog
src/gmalloc.c

index c390352004be814f4187e4787bb31208a7185b58..6943c745311cf126245a5c3a406934dd5e3e9a29 100644 (file)
@@ -1,3 +1,26 @@
+2000-10-20  Gerd Moellmann  <gerd@gnu.org>
+
+       * alloc.c (toplevel) [SYSTEM_MALLOC || DOUG_LEA_MALLOC]: Undef
+       GC_MALLOC_CHECK.
+       (toplevel) [GC_MARK_STACK || GC_MALLOC_CHECK]: Move mem_node
+       structure definition and related variabled to the top of the file.
+       Include this code when GC_MALLOC_CHECK is defined.
+       (lisp_malloc, lisp_free) [GC_MALLOC_CHECK]: Don't
+       register/unregister allocated region.
+       (emacs_blocked_free) [GC_MALLOC_CHECK]: Check if freeing something
+       which isn't allocated.
+       (emacs_blocked_malloc) [GC_MALLOC_CHECK]: Check if returning
+       something which is already in use.
+       (emacs_blocked_realloc) [GC_MALLOC_CHECK]: Likewise.
+       (mem_insert) [GC_MALLOC_CHECK]: Use _malloc_internal.
+       (mem_delete) [GC_MALLOC_CHECK]: Use _free_internal.
+       (init_alloc_once) [GC_MALLOC_CHECK]: Call mem_init.
+
+       * gmalloc.c (_malloc_internal) [GC_MALLOC_CHECK]: Use
+       _malloc_internal instead of malloc.
+       (_free_internal) [GC_MALLOC_CHECK]: Use _free_internal instead
+       of free.
+
 2000-10-20  Andrew Innes  <andrewi@gnu.org>
 
        * strftime.c [!WINDOWSNT]: Don't apply Solaris 2.5 work-around on
index e05b758b766a57c3523795e9cc39613d7ba7bd93..2ce168c71c8a748e983a1d6938d986bc984a6de7 100644 (file)
@@ -678,7 +678,11 @@ _malloc_internal (size)
        {
          /* No free fragments of the desired size, so get a new block
             and break it into fragments, returning the first.  */
+#ifdef GC_MALLOC_CHECK
+         result = _malloc_internal (BLOCKSIZE);
+#else
          result = malloc (BLOCKSIZE);
+#endif
          if (result == NULL)
            return NULL;
 
@@ -1092,7 +1096,11 @@ _free_internal (ptr)
          _chunks_free -= BLOCKSIZE >> type;
          _bytes_free -= BLOCKSIZE;
 
+#ifdef GC_MALLOC_CHECK
+         _free_internal (ADDRESS (block));
+#else
          free (ADDRESS (block));
+#endif
        }
       else if (_heapinfo[block].busy.info.frag.nfree != 0)
        {