summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-01-25 07:10:04 +0000
committerMiles Bader <miles@gnu.org>2006-01-25 07:10:04 +0000
commitb2ba4dcba149f845bf7fcf15b6cede6a6cbcc336 (patch)
treed9ca500b0501201584dbab3b74a83d1ba7e374c9 /src/alloc.c
parent90fc2bc59774318b3db7c3642df00a1297f6b7ff (diff)
parent7347faa822b5ea177df5b2ed7a2b7d79194f0bcc (diff)
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-7
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 4-14) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (base, patch 1-7) - tag of miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-187 - Update from CVS - Merge from emacs--devo--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10 (patch 187) - Update from CVS
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 1ef8f97b040..48065382480 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
/* Storage allocation and gc for GNU Emacs Lisp interpreter.
Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -1105,6 +1105,9 @@ lisp_align_free (block)
}
eassert ((aligned & 1) == aligned);
eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1));
+#ifdef HAVE_POSIX_MEMALIGN
+ eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0);
+#endif
free (ABLOCKS_BASE (abase));
}
UNBLOCK_INPUT;
@@ -1419,6 +1422,8 @@ make_interval ()
{
INTERVAL val;
+ eassert (!handling_signal);
+
if (interval_free_list)
{
val = interval_free_list;
@@ -1837,6 +1842,8 @@ allocate_string ()
{
struct Lisp_String *s;
+ eassert (!handling_signal);
+
/* If the free-list is empty, allocate a new string_block, and
add all the Lisp_Strings in it to the free-list. */
if (string_free_list == NULL)
@@ -1971,6 +1978,8 @@ allocate_string_data (s, nchars, nbytes)
old_nbytes = GC_STRING_BYTES (s);
data = b->next_free;
+ b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA);
+
data->string = s;
s->data = SDATA_DATA (data);
#ifdef GC_CHECK_STRING_BYTES
@@ -1983,7 +1992,6 @@ allocate_string_data (s, nchars, nbytes)
bcopy (string_overrun_cookie, (char *) data + needed,
GC_STRING_OVERRUN_COOKIE_SIZE);
#endif
- b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA);
/* If S had already data assigned, mark that as free by setting its
string back-pointer to null, and recording the size of the data
@@ -2552,6 +2560,8 @@ make_float (float_value)
{
register Lisp_Object val;
+ eassert (!handling_signal);
+
if (float_free_list)
{
/* We use the data field for chaining the free list
@@ -2671,6 +2681,8 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
{
register Lisp_Object val;
+ eassert (!handling_signal);
+
if (cons_free_list)
{
/* We use the cdr for chaining the free list
@@ -2852,6 +2864,9 @@ allocate_vectorlike (len, type)
UNBLOCK_INPUT;
#endif
+ /* This gets triggered by code which I haven't bothered to fix. --Stef */
+ /* eassert (!handling_signal); */
+
nbytes = sizeof *p + (len - 1) * sizeof p->contents[0];
p = (struct Lisp_Vector *) lisp_malloc (nbytes, type);
@@ -3102,6 +3117,8 @@ Its value and function definition are void, and its property list is nil. */)
CHECK_STRING (name);
+ eassert (!handling_signal);
+
if (symbol_free_list)
{
XSETSYMBOL (val, symbol_free_list);
@@ -3182,6 +3199,8 @@ allocate_misc ()
{
Lisp_Object val;
+ eassert (!handling_signal);
+
if (marker_free_list)
{
XSETMISC (val, marker_free_list);