From: Richard M. Stallman Date: Sat, 12 Jul 1997 07:04:43 +0000 (+0000) Subject: (r_alloc_reinit): New function. X-Git-Tag: emacs-20.1~1189 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dec414188f5a04db0ac23ba29515de0a1f3ed4b8;p=emacs.git (r_alloc_reinit): New function. --- diff --git a/src/ralloc.c b/src/ralloc.c index 5373212a483..d1ce3be24fc 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1150,6 +1150,24 @@ r_alloc_init () virtual_break_value = break_value = first_heap->bloc_start = first_heap->end; use_relocatable_buffers = 1; } + +#if defined (emacs) && defined (DOUG_LEA_MALLOC) + +/* Reinitialize the morecore hook variables after restarting a dumped + Emacs. This is needed when using Doug Lea's malloc from GNU libc. */ +void +r_alloc_reinit () +{ + /* Only do this if the hook has been reset, so that we don't get an + infinite loop, in case Emacs was linked statically. */ + if (__morecore != r_alloc_sbrk) + { + real_morecore = __morecore; + __morecore = r_alloc_sbrk; + } +} +#endif + #ifdef DEBUG #include