comparison src/alloc.c @ 69873:2d844bbbccd4

* 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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 08 Apr 2006 15:07:35 +0000
parents a685fca1ccb6
children 272487a77b8e
comparison
equal deleted inserted replaced
69872:f60a24914ee2 69873:2d844bbbccd4
3001 3001
3002 3002
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 }
3016 3020
3017 3021
5556 CHECK_LIVE (live_vector_p); 5560 CHECK_LIVE (live_vector_p);
5557 VECTOR_MARK (ptr); /* Else mark it */ 5561 VECTOR_MARK (ptr); /* Else mark it */
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 }
5564 break; 5572 break;
5565 5573