Mercurial > emacs
comparison src/alloc.c @ 83507:81f2d90dee68
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
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 10 Apr 2006 14:52:24 +0000 |
parents | 0cdee8b991e1 272487a77b8e |
children | 02e39decdc84 |
comparison
equal
deleted
inserted
replaced
83506:9905fc171253 | 83507:81f2d90dee68 |
---|---|
20 Boston, MA 02110-1301, USA. */ | 20 Boston, MA 02110-1301, USA. */ |
21 | 21 |
22 #include <config.h> | 22 #include <config.h> |
23 #include <stdio.h> | 23 #include <stdio.h> |
24 #include <limits.h> /* For CHAR_BIT. */ | 24 #include <limits.h> /* For CHAR_BIT. */ |
25 | |
26 #ifdef STDC_HEADERS | |
27 #include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */ | |
28 #endif | |
25 | 29 |
26 #ifdef ALLOC_DEBUG | 30 #ifdef ALLOC_DEBUG |
27 #undef INLINE | 31 #undef INLINE |
28 #endif | 32 #endif |
29 | 33 |
3003 | 3007 |
3004 | 3008 |
3005 struct Lisp_Process * | 3009 struct Lisp_Process * |
3006 allocate_process () | 3010 allocate_process () |
3007 { | 3011 { |
3008 EMACS_INT len = VECSIZE (struct Lisp_Process); | 3012 /* Memory-footprint of the object in nb of Lisp_Object fields. */ |
3009 struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_PROCESS); | 3013 EMACS_INT memlen = VECSIZE (struct Lisp_Process); |
3014 /* Size if we only count the actual Lisp_Object fields (which need to be | |
3015 traced by the GC). */ | |
3016 EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid); | |
3017 struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS); | |
3010 EMACS_INT i; | 3018 EMACS_INT i; |
3011 | 3019 |
3012 for (i = 0; i < len; ++i) | 3020 for (i = 0; i < lisplen; ++i) |
3013 v->contents[i] = Qnil; | 3021 v->contents[i] = Qnil; |
3014 v->size = len; | 3022 v->size = lisplen; |
3015 | 3023 |
3016 return (struct Lisp_Process *) v; | 3024 return (struct Lisp_Process *) v; |
3017 } | 3025 } |
3018 | 3026 |
3019 | 3027 |
5561 CHECK_LIVE (live_vector_p); | 5569 CHECK_LIVE (live_vector_p); |
5562 VECTOR_MARK (ptr); /* Else mark it */ | 5570 VECTOR_MARK (ptr); /* Else mark it */ |
5563 if (size & PSEUDOVECTOR_FLAG) | 5571 if (size & PSEUDOVECTOR_FLAG) |
5564 size &= PSEUDOVECTOR_SIZE_MASK; | 5572 size &= PSEUDOVECTOR_SIZE_MASK; |
5565 | 5573 |
5574 /* Note that this size is not the memory-footprint size, but only | |
5575 the number of Lisp_Object fields that we should trace. | |
5576 The distinction is used e.g. by Lisp_Process which places extra | |
5577 non-Lisp_Object fields at the end of the structure. */ | |
5566 for (i = 0; i < size; i++) /* and then mark its elements */ | 5578 for (i = 0; i < size; i++) /* and then mark its elements */ |
5567 mark_object (ptr->contents[i]); | 5579 mark_object (ptr->contents[i]); |
5568 } | 5580 } |
5569 break; | 5581 break; |
5570 | 5582 |