mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-20 02:30:23 +02:00
* alloca.c: Use scm_must_malloc to obtain storage. Hopefully this
works; I can't conveniently test it myself. (Thanks to Dvid Tillman for the bug report.)
This commit is contained in:
parent
48ca6468ab
commit
ce6ed4bae6
1 changed files with 3 additions and 15 deletions
|
@ -25,6 +25,9 @@
|
||||||
#include <scmconfig.h>
|
#include <scmconfig.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define malloc(size) (scm_must_malloc ((size), "alloca emulation"))
|
||||||
|
extern char *scm_must_malloc ();
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -77,21 +80,6 @@ typedef char *pointer;
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Different portions of Emacs need to call different versions of
|
|
||||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
|
||||||
ordinary malloc isn't protected from input signals. On the other
|
|
||||||
hand, the utilities in lib-src need alloca to call malloc; some of
|
|
||||||
them are very simple, and don't have an xmalloc routine.
|
|
||||||
|
|
||||||
Non-Emacs programs expect this to call use xmalloc.
|
|
||||||
|
|
||||||
Callers below should use malloc. */
|
|
||||||
|
|
||||||
#ifndef emacs
|
|
||||||
#define malloc xmalloc
|
|
||||||
#endif
|
|
||||||
extern pointer malloc ();
|
|
||||||
|
|
||||||
/* Define STACK_DIRECTION if you know the direction of stack
|
/* Define STACK_DIRECTION if you know the direction of stack
|
||||||
growth for your system; otherwise it will be automatically
|
growth for your system; otherwise it will be automatically
|
||||||
deduced at run-time.
|
deduced at run-time.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue