diff options
| author | Stefan Monnier | 2006-04-08 15:07:35 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-04-08 15:07:35 +0000 |
| commit | 6bfd98e75de5ae13bdceddb7effda6bb41bedf79 (patch) | |
| tree | f2b62be97f00d1c098052376bf531dddb635dfb7 /src/alloc.c | |
| parent | 67438f773f7ac8f651029661ab9b578b80ba0722 (diff) | |
| download | emacs-6bfd98e75de5ae13bdceddb7effda6bb41bedf79.tar.gz emacs-6bfd98e75de5ae13bdceddb7effda6bb41bedf79.zip | |
* 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 () | |||
| 3003 | struct Lisp_Process * | 3003 | struct Lisp_Process * |
| 3004 | allocate_process () | 3004 | allocate_process () |
| 3005 | { | 3005 | { |
| 3006 | EMACS_INT len = VECSIZE (struct Lisp_Process); | 3006 | /* Memory-footprint of the object in nb of Lisp_Object fields. */ |
| 3007 | struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_PROCESS); | 3007 | EMACS_INT memlen = VECSIZE (struct Lisp_Process); |
| 3008 | /* Size if we only count the actual Lisp_Object fields (which need to be | ||
| 3009 | traced by the GC). */ | ||
| 3010 | EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid); | ||
| 3011 | struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS); | ||
| 3008 | EMACS_INT i; | 3012 | EMACS_INT i; |
| 3009 | 3013 | ||
| 3010 | for (i = 0; i < len; ++i) | 3014 | for (i = 0; i < lisplen; ++i) |
| 3011 | v->contents[i] = Qnil; | 3015 | v->contents[i] = Qnil; |
| 3012 | v->size = len; | 3016 | v->size = lisplen; |
| 3013 | 3017 | ||
| 3014 | return (struct Lisp_Process *) v; | 3018 | return (struct Lisp_Process *) v; |
| 3015 | } | 3019 | } |
| @@ -5558,6 +5562,10 @@ mark_object (arg) | |||
| 5558 | if (size & PSEUDOVECTOR_FLAG) | 5562 | if (size & PSEUDOVECTOR_FLAG) |
| 5559 | size &= PSEUDOVECTOR_SIZE_MASK; | 5563 | size &= PSEUDOVECTOR_SIZE_MASK; |
| 5560 | 5564 | ||
| 5565 | /* Note that this size is not the memory-footprint size, but only | ||
| 5566 | the number of Lisp_Object fields that we should trace. | ||
| 5567 | The distinction is used e.g. by Lisp_Process which places extra | ||
| 5568 | non-Lisp_Object fields at the end of the structure. */ | ||
| 5561 | for (i = 0; i < size; i++) /* and then mark its elements */ | 5569 | for (i = 0; i < size; i++) /* and then mark its elements */ |
| 5562 | mark_object (ptr->contents[i]); | 5570 | mark_object (ptr->contents[i]); |
| 5563 | } | 5571 | } |