diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-04-08 15:07:35 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-04-08 15:07:35 +0000 |
commit | 6bfd98e75de5ae13bdceddb7effda6bb41bedf79 (patch) | |
tree | f2b62be97f00d1c098052376bf531dddb635dfb7 /src/alloc.c | |
parent | 67438f773f7ac8f651029661ab9b578b80ba0722 (diff) | |
download | emacs-6bfd98e75de5ae13bdceddb7effda6bb41bedf79.tar.gz |
* process.h (struct Lisp_Process): Replace Lisp_Objects `pid',
`raw_status_high', and `raw_status_low' with plain integers, and move
them to the end of the structure.
* alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the
pseudovector's size field so only the Lisp_Object fields get GC'd.
* process.c (update_status, make_process, Fdelete_process)
(Fprocess_status, list_processes_1, start_process_unwind)
(create_process, Fmake_network_process, server_accept_connection)
(wait_reading_process_output, send_process, Fprocess_running_child_p)
(process_send_signal, proc_encode_coding_system, Fprocess_send_eof)
(sigchld_handler, status_notify): Adjust to new non-Lisp fields for
`pid' and `raw_status'.
(Fprocess_id, Fsignal_process): Same, and additionally use floats when
representing PIDs that are larger than most-positive-fixnum.
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c index e3b65c1a4f4..5b42a0016a8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3003,13 +3003,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; } @@ -5558,6 +5562,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]); } |