diff options
| author | Miles Bader | 2006-04-09 00:38:22 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-04-09 00:38:22 +0000 |
| commit | 49d395cd57e646162e7f646a8561a416abacac82 (patch) | |
| tree | d7fabed45dfc19d6bff30024f82613f372b97951 /src/alloc.c | |
| parent | b6828792a25d042ede1ed164389531e30cc3e202 (diff) | |
| parent | 1b155fbd766b0a0f78fca5de62dd16a3542883f1 (diff) | |
| download | emacs-49d395cd57e646162e7f646a8561a416abacac82.tar.gz emacs-49d395cd57e646162e7f646a8561a416abacac82.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-54
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 190-203)
- Update from CVS
- Undo incorrect merge of etc/images/README from Gnus 5.10
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 74-80)
- Update from CVS
- Update from CVS: README: Addition from 5.10.6 tar ball.
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 549f14625e6..7fd1560708a 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -23,6 +23,10 @@ Boston, MA 02110-1301, USA. */ | |||
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | #include <limits.h> /* For CHAR_BIT. */ | 24 | #include <limits.h> /* For CHAR_BIT. */ |
| 25 | 25 | ||
| 26 | #ifdef STDC_HEADERS | ||
| 27 | #include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */ | ||
| 28 | #endif | ||
| 29 | |||
| 26 | #ifdef ALLOC_DEBUG | 30 | #ifdef ALLOC_DEBUG |
| 27 | #undef INLINE | 31 | #undef INLINE |
| 28 | #endif | 32 | #endif |
| @@ -3003,13 +3007,17 @@ allocate_frame () | |||
| 3003 | struct Lisp_Process * | 3007 | struct Lisp_Process * |
| 3004 | allocate_process () | 3008 | allocate_process () |
| 3005 | { | 3009 | { |
| 3006 | EMACS_INT len = VECSIZE (struct Lisp_Process); | 3010 | /* Memory-footprint of the object in nb of Lisp_Object fields. */ |
| 3007 | struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_PROCESS); | 3011 | EMACS_INT memlen = VECSIZE (struct Lisp_Process); |
| 3012 | /* Size if we only count the actual Lisp_Object fields (which need to be | ||
| 3013 | traced by the GC). */ | ||
| 3014 | EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid); | ||
| 3015 | struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS); | ||
| 3008 | EMACS_INT i; | 3016 | EMACS_INT i; |
| 3009 | 3017 | ||
| 3010 | for (i = 0; i < len; ++i) | 3018 | for (i = 0; i < lisplen; ++i) |
| 3011 | v->contents[i] = Qnil; | 3019 | v->contents[i] = Qnil; |
| 3012 | v->size = len; | 3020 | v->size = lisplen; |
| 3013 | 3021 | ||
| 3014 | return (struct Lisp_Process *) v; | 3022 | return (struct Lisp_Process *) v; |
| 3015 | } | 3023 | } |
| @@ -5515,6 +5523,10 @@ mark_object (arg) | |||
| 5515 | if (size & PSEUDOVECTOR_FLAG) | 5523 | if (size & PSEUDOVECTOR_FLAG) |
| 5516 | size &= PSEUDOVECTOR_SIZE_MASK; | 5524 | size &= PSEUDOVECTOR_SIZE_MASK; |
| 5517 | 5525 | ||
| 5526 | /* Note that this size is not the memory-footprint size, but only | ||
| 5527 | the number of Lisp_Object fields that we should trace. | ||
| 5528 | The distinction is used e.g. by Lisp_Process which places extra | ||
| 5529 | non-Lisp_Object fields at the end of the structure. */ | ||
| 5518 | for (i = 0; i < size; i++) /* and then mark its elements */ | 5530 | for (i = 0; i < size; i++) /* and then mark its elements */ |
| 5519 | mark_object (ptr->contents[i]); | 5531 | mark_object (ptr->contents[i]); |
| 5520 | } | 5532 | } |