diff options
| author | Gerd Moellmann | 2000-10-20 15:57:00 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-10-20 15:57:00 +0000 |
| commit | 8094989ba2229aeb562284ac96034252ad0c90c8 (patch) | |
| tree | 80683494a60436459243ed8fa593f73e5e61182b /src | |
| parent | 877935b1f574db32339050788147d677fc3cce27 (diff) | |
| download | emacs-8094989ba2229aeb562284ac96034252ad0c90c8.tar.gz emacs-8094989ba2229aeb562284ac96034252ad0c90c8.zip | |
(_malloc_internal) [GC_MALLOC_CHECK]: Use
_malloc_internal instead of malloc.
(_free_internal) [GC_MALLOC_CHECK]: Use _free_internal instead
of free.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 23 | ||||
| -rw-r--r-- | src/gmalloc.c | 8 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c390352004b..6943c745311 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2000-10-20 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * alloc.c (toplevel) [SYSTEM_MALLOC || DOUG_LEA_MALLOC]: Undef | ||
| 4 | GC_MALLOC_CHECK. | ||
| 5 | (toplevel) [GC_MARK_STACK || GC_MALLOC_CHECK]: Move mem_node | ||
| 6 | structure definition and related variabled to the top of the file. | ||
| 7 | Include this code when GC_MALLOC_CHECK is defined. | ||
| 8 | (lisp_malloc, lisp_free) [GC_MALLOC_CHECK]: Don't | ||
| 9 | register/unregister allocated region. | ||
| 10 | (emacs_blocked_free) [GC_MALLOC_CHECK]: Check if freeing something | ||
| 11 | which isn't allocated. | ||
| 12 | (emacs_blocked_malloc) [GC_MALLOC_CHECK]: Check if returning | ||
| 13 | something which is already in use. | ||
| 14 | (emacs_blocked_realloc) [GC_MALLOC_CHECK]: Likewise. | ||
| 15 | (mem_insert) [GC_MALLOC_CHECK]: Use _malloc_internal. | ||
| 16 | (mem_delete) [GC_MALLOC_CHECK]: Use _free_internal. | ||
| 17 | (init_alloc_once) [GC_MALLOC_CHECK]: Call mem_init. | ||
| 18 | |||
| 19 | * gmalloc.c (_malloc_internal) [GC_MALLOC_CHECK]: Use | ||
| 20 | _malloc_internal instead of malloc. | ||
| 21 | (_free_internal) [GC_MALLOC_CHECK]: Use _free_internal instead | ||
| 22 | of free. | ||
| 23 | |||
| 1 | 2000-10-20 Andrew Innes <andrewi@gnu.org> | 24 | 2000-10-20 Andrew Innes <andrewi@gnu.org> |
| 2 | 25 | ||
| 3 | * strftime.c [!WINDOWSNT]: Don't apply Solaris 2.5 work-around on | 26 | * strftime.c [!WINDOWSNT]: Don't apply Solaris 2.5 work-around on |
diff --git a/src/gmalloc.c b/src/gmalloc.c index e05b758b766..2ce168c71c8 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -678,7 +678,11 @@ _malloc_internal (size) | |||
| 678 | { | 678 | { |
| 679 | /* No free fragments of the desired size, so get a new block | 679 | /* No free fragments of the desired size, so get a new block |
| 680 | and break it into fragments, returning the first. */ | 680 | and break it into fragments, returning the first. */ |
| 681 | #ifdef GC_MALLOC_CHECK | ||
| 682 | result = _malloc_internal (BLOCKSIZE); | ||
| 683 | #else | ||
| 681 | result = malloc (BLOCKSIZE); | 684 | result = malloc (BLOCKSIZE); |
| 685 | #endif | ||
| 682 | if (result == NULL) | 686 | if (result == NULL) |
| 683 | return NULL; | 687 | return NULL; |
| 684 | 688 | ||
| @@ -1092,7 +1096,11 @@ _free_internal (ptr) | |||
| 1092 | _chunks_free -= BLOCKSIZE >> type; | 1096 | _chunks_free -= BLOCKSIZE >> type; |
| 1093 | _bytes_free -= BLOCKSIZE; | 1097 | _bytes_free -= BLOCKSIZE; |
| 1094 | 1098 | ||
| 1099 | #ifdef GC_MALLOC_CHECK | ||
| 1100 | _free_internal (ADDRESS (block)); | ||
| 1101 | #else | ||
| 1095 | free (ADDRESS (block)); | 1102 | free (ADDRESS (block)); |
| 1103 | #endif | ||
| 1096 | } | 1104 | } |
| 1097 | else if (_heapinfo[block].busy.info.frag.nfree != 0) | 1105 | else if (_heapinfo[block].busy.info.frag.nfree != 0) |
| 1098 | { | 1106 | { |