Mercurial > emacs
changeset 9969:007d93b04e1f
(make_process): Use allocate_vectorlike and VECSIZE.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 16 Nov 1994 05:03:02 +0000 |
parents | 943a61c764a5 |
children | 76910d506a80 |
files | src/process.c |
diffstat | 1 files changed, 8 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/process.c Wed Nov 16 04:48:37 1994 +0000 +++ b/src/process.c Wed Nov 16 05:03:02 1994 +0000 @@ -467,22 +467,18 @@ make_process (name) Lisp_Object name; { + struct Lisp_Vector *vec; register Lisp_Object val, tem, name1; register struct Lisp_Process *p; char suffix[10]; register int i; - /* size of process structure includes the vector header, - so deduct for that. But struct Lisp_Vector includes the first - element, thus deducts too much, so add it back. */ - val = Fmake_vector (make_number ((sizeof (struct Lisp_Process) - - sizeof (struct Lisp_Vector) - + sizeof (Lisp_Object)) - / sizeof (Lisp_Object)), - Qnil); - XSETTYPE (val, Lisp_Process); - - p = XPROCESS (val); + vec = allocate_vectorlike ((EMACS_INT) VECSIZE (struct Lisp_Process)); + for (i = 0; i < VECSIZE (struct Lisp_Process); i++) + vec->contents[i] = Qnil; + vec->size = VECSIZE (struct Lisp_Process); + p = (struct Lisp_Process *)vec; + XSETINT (p->infd, -1); XSETINT (p->outfd, -1); XSETFASTINT (p->pid, 0); @@ -505,6 +501,7 @@ } name = name1; p->name = name; + XSETPROCESS (val, p); Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist); return val; }