diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-04-10 14:52:24 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-04-10 14:52:24 +0000 |
commit | e349ae3b6b6db99d11321622fadff88bc42c1125 (patch) | |
tree | 7a24a5dad70d4b3695f227681fc37e179551d24a /src/alloc.c | |
parent | 2518de51d20e848711c712f5030e8c207a4e2840 (diff) | |
parent | 4f07f2e8a5458758dcf2bfbdf9b0cf8c91a8572e (diff) | |
download | emacs-e349ae3b6b6db99d11321622fadff88bc42c1125.tar.gz |
Merged from
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-188
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-189
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-190
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-191
Undo incorrect merge of etc/images/README from Gnus 5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-192
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-193
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-194
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-195
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-196
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-197
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-198
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-199
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-200
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-201
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-202
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-203
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-204
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-205
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-206
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-73
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-74
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-75
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-76
Update from CVS: README: Addition from 5.10.6 tar ball.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-77
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-78
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-79
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-80
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-547
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c index 259143ffad8..8088540bb6b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -23,6 +23,10 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <limits.h> /* For CHAR_BIT. */ +#ifdef STDC_HEADERS +#include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */ +#endif + #ifdef ALLOC_DEBUG #undef INLINE #endif @@ -3005,13 +3009,17 @@ allocate_frame () struct Lisp_Process * allocate_process () { - EMACS_INT len = VECSIZE (struct Lisp_Process); - struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_PROCESS); + /* Memory-footprint of the object in nb of Lisp_Object fields. */ + EMACS_INT memlen = VECSIZE (struct Lisp_Process); + /* Size if we only count the actual Lisp_Object fields (which need to be + traced by the GC). */ + EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid); + struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS); EMACS_INT i; - for (i = 0; i < len; ++i) + for (i = 0; i < lisplen; ++i) v->contents[i] = Qnil; - v->size = len; + v->size = lisplen; return (struct Lisp_Process *) v; } @@ -5563,6 +5571,10 @@ mark_object (arg) if (size & PSEUDOVECTOR_FLAG) size &= PSEUDOVECTOR_SIZE_MASK; + /* Note that this size is not the memory-footprint size, but only + the number of Lisp_Object fields that we should trace. + The distinction is used e.g. by Lisp_Process which places extra + non-Lisp_Object fields at the end of the structure. */ for (i = 0; i < size; i++) /* and then mark its elements */ mark_object (ptr->contents[i]); } |