aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorStefan Monnier2006-01-23 02:35:36 +0000
committerStefan Monnier2006-01-23 02:35:36 +0000
commitcfb2f32e41fd97d98129f6bc17991d1b7a906a47 (patch)
tree6602171402591e1231cacf3cbcf7d19ff9d0da12 /src/alloc.c
parentf9cd958249a8b5e01fdce2a90ddd235e3b9c305c (diff)
downloademacs-cfb2f32e41fd97d98129f6bc17991d1b7a906a47.tar.gz
emacs-cfb2f32e41fd97d98129f6bc17991d1b7a906a47.zip
(lisp_align_free): Add an assertion.
(make_interval, allocate_string, make_float, allocate_misc, Fmake_symbol (Fcons): If ENABLE_CHECKING is on, check we're not called from a sighandler.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 96934269d23..d81a9bf853b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1105,6 +1105,9 @@ lisp_align_free (block)
1105 } 1105 }
1106 eassert ((aligned & 1) == aligned); 1106 eassert ((aligned & 1) == aligned);
1107 eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1)); 1107 eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1));
1108#ifdef HAVE_POSIX_MEMALIGN
1109 eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0);
1110#endif
1108 free (ABLOCKS_BASE (abase)); 1111 free (ABLOCKS_BASE (abase));
1109 } 1112 }
1110 UNBLOCK_INPUT; 1113 UNBLOCK_INPUT;
@@ -1419,6 +1422,8 @@ make_interval ()
1419{ 1422{
1420 INTERVAL val; 1423 INTERVAL val;
1421 1424
1425 eassert (!handling_signal);
1426
1422 if (interval_free_list) 1427 if (interval_free_list)
1423 { 1428 {
1424 val = interval_free_list; 1429 val = interval_free_list;
@@ -1837,6 +1842,8 @@ allocate_string ()
1837{ 1842{
1838 struct Lisp_String *s; 1843 struct Lisp_String *s;
1839 1844
1845 eassert (!handling_signal);
1846
1840 /* If the free-list is empty, allocate a new string_block, and 1847 /* If the free-list is empty, allocate a new string_block, and
1841 add all the Lisp_Strings in it to the free-list. */ 1848 add all the Lisp_Strings in it to the free-list. */
1842 if (string_free_list == NULL) 1849 if (string_free_list == NULL)
@@ -2552,6 +2559,8 @@ make_float (float_value)
2552{ 2559{
2553 register Lisp_Object val; 2560 register Lisp_Object val;
2554 2561
2562 eassert (!handling_signal);
2563
2555 if (float_free_list) 2564 if (float_free_list)
2556 { 2565 {
2557 /* We use the data field for chaining the free list 2566 /* We use the data field for chaining the free list
@@ -2671,6 +2680,8 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
2671{ 2680{
2672 register Lisp_Object val; 2681 register Lisp_Object val;
2673 2682
2683 eassert (!handling_signal);
2684
2674 if (cons_free_list) 2685 if (cons_free_list)
2675 { 2686 {
2676 /* We use the cdr for chaining the free list 2687 /* We use the cdr for chaining the free list
@@ -2852,6 +2863,9 @@ allocate_vectorlike (len, type)
2852 UNBLOCK_INPUT; 2863 UNBLOCK_INPUT;
2853#endif 2864#endif
2854 2865
2866 /* This gets triggered by code which I haven't bothered to fix. --Stef */
2867 /* eassert (!handling_signal); */
2868
2855 nbytes = sizeof *p + (len - 1) * sizeof p->contents[0]; 2869 nbytes = sizeof *p + (len - 1) * sizeof p->contents[0];
2856 p = (struct Lisp_Vector *) lisp_malloc (nbytes, type); 2870 p = (struct Lisp_Vector *) lisp_malloc (nbytes, type);
2857 2871
@@ -3145,6 +3159,8 @@ Its value and function definition are void, and its property list is nil. */)
3145 3159
3146 CHECK_STRING (name); 3160 CHECK_STRING (name);
3147 3161
3162 eassert (!handling_signal);
3163
3148 if (symbol_free_list) 3164 if (symbol_free_list)
3149 { 3165 {
3150 XSETSYMBOL (val, symbol_free_list); 3166 XSETSYMBOL (val, symbol_free_list);
@@ -3225,6 +3241,8 @@ allocate_misc ()
3225{ 3241{
3226 Lisp_Object val; 3242 Lisp_Object val;
3227 3243
3244 eassert (!handling_signal);
3245
3228 if (marker_free_list) 3246 if (marker_free_list)
3229 { 3247 {
3230 XSETMISC (val, marker_free_list); 3248 XSETMISC (val, marker_free_list);