(emacs_blocked_free) [GC_MALLOC_CHECK]: Handle freeing

null.
This commit is contained in:
Gerd Moellmann 2000-10-23 15:03:55 +00:00
parent 182334bd08
commit a83fee2c56
2 changed files with 25 additions and 17 deletions

View file

@ -1,3 +1,10 @@
2000-10-23 Gerd Moellmann <gerd@gnu.org>
* xterm.c (x_connection_closed): Reset handling_signal.
* alloc.c (emacs_blocked_free) [GC_MALLOC_CHECK]: Handle freeing
null.
2000-10-23 Miles Bader <miles@gnu.org>
* window.c (window_scroll_pixel_based, window_scroll_line_based):
@ -11,7 +18,7 @@
that when a font can't be exactly centered, it errs up rather than
down.
2000-10-22 15:07:47 ShengHuo ZHU <zsh@cs.rochester.edu>
2000-10-22 ShengHuo ZHU <zsh@cs.rochester.edu>
* fns.c (Fbase64_decode_string): The decoded result should be
unibyte.
@ -21,7 +28,7 @@
* dispextern.h [macintosh]: Include macgui.h instead of macterm.h.
* dispnew.c [macintosh]: Include macterm.h.
(init_display) [macintosh]: initialization for window system.
(init_display) [macintosh]: Initialization for window system.
* emacs.c (main) [macintosh]: Call syms_of_textprop,
syms_of_macfns, syms_of_ccl, syms_of_fontset, syms_of_xterm,

View file

@ -655,22 +655,23 @@ emacs_blocked_free (ptr)
BLOCK_INPUT;
#ifdef GC_MALLOC_CHECK
{
struct mem_node *m;
if (ptr)
{
struct mem_node *m;
m = mem_find (ptr);
if (m == MEM_NIL || m->start != ptr)
{
fprintf (stderr,
"Freeing `%p' which wasn't allocated with malloc\n", ptr);
abort ();
}
else
{
/* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */
mem_delete (m);
}
}
m = mem_find (ptr);
if (m == MEM_NIL || m->start != ptr)
{
fprintf (stderr,
"Freeing `%p' which wasn't allocated with malloc\n", ptr);
abort ();
}
else
{
/* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */
mem_delete (m);
}
}
#endif /* GC_MALLOC_CHECK */
__free_hook = old_free_hook;