comparison src/eval.c @ 5140:e5380fdaf8f1

merge
author Ben Wing <ben@xemacs.org>
date Sat, 13 Mar 2010 05:38:34 -0600
parents 7be849cb8828
children f965e31a35f0
comparison
equal deleted inserted replaced
5139:a48ef26d87ee 5140:e5380fdaf8f1
465 static const struct memory_description subr_description[] = { 465 static const struct memory_description subr_description[] = {
466 { XD_DOC_STRING, offsetof (Lisp_Subr, doc), 0, { 0 }, XD_FLAG_NO_KKCC }, 466 { XD_DOC_STRING, offsetof (Lisp_Subr, doc), 0, { 0 }, XD_FLAG_NO_KKCC },
467 { XD_END } 467 { XD_END }
468 }; 468 };
469 469
470 DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, 470 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("subr", subr,
471 1, /*dumpable-flag*/ 471 0, print_subr, 0, 0, 0,
472 0, print_subr, 0, 0, 0, 472 subr_description,
473 subr_description, 473 Lisp_Subr);
474 Lisp_Subr);
475 474
476 /************************************************************************/ 475 /************************************************************************/
477 /* Entering the debugger */ 476 /* Entering the debugger */
478 /************************************************************************/ 477 /************************************************************************/
479 478
4518 Elemcount first_desired, Elemcount upper_limit) 4517 Elemcount first_desired, Elemcount upper_limit)
4519 { 4518 {
4520 Bytecount sizem; 4519 Bytecount sizem;
4521 struct multiple_value *mv; 4520 struct multiple_value *mv;
4522 Elemcount i, allocated_count; 4521 Elemcount i, allocated_count;
4522 Lisp_Object mvobj;
4523 4523
4524 assert (count != 1); 4524 assert (count != 1);
4525 4525
4526 if (1 != upper_limit && (0 == first_desired)) 4526 if (1 != upper_limit && (0 == first_desired))
4527 { 4527 {
4543 } 4543 }
4544 4544
4545 sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (multiple_value, 4545 sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (multiple_value,
4546 Lisp_Object, 4546 Lisp_Object,
4547 contents, allocated_count); 4547 contents, allocated_count);
4548 mv = (multiple_value *) BASIC_ALLOC_LCRECORD (sizem, 4548 mvobj = ALLOC_SIZED_LISP_OBJECT (sizem, multiple_value);
4549 &lrecord_multiple_value); 4549 mv = XMULTIPLE_VALUE (mvobj);
4550 4550
4551 mv->count = count; 4551 mv->count = count;
4552 mv->first_desired = first_desired; 4552 mv->first_desired = first_desired;
4553 mv->allocated_count = allocated_count; 4553 mv->allocated_count = allocated_count;
4554 mv->contents[0] = first_value; 4554 mv->contents[0] = first_value;
4556 for (i = first_desired; i < upper_limit && i < count; ++i) 4556 for (i = first_desired; i < upper_limit && i < count; ++i)
4557 { 4557 {
4558 mv->contents[1 + (i - first_desired)] = Qunbound; 4558 mv->contents[1 + (i - first_desired)] = Qunbound;
4559 } 4559 }
4560 4560
4561 return wrap_multiple_value (mv); 4561 return mvobj;
4562 } 4562 }
4563 4563
4564 void 4564 void
4565 multiple_value_aset (Lisp_Object obj, Elemcount index, Lisp_Object value) 4565 multiple_value_aset (Lisp_Object obj, Elemcount index, Lisp_Object value)
4566 { 4566 {
4651 4651
4652 return Qnil; 4652 return Qnil;
4653 } 4653 }
4654 4654
4655 static Bytecount 4655 static Bytecount
4656 size_multiple_value (const void *lheader) 4656 size_multiple_value (Lisp_Object obj)
4657 { 4657 {
4658 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (struct multiple_value, 4658 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (struct multiple_value,
4659 Lisp_Object, contents, 4659 Lisp_Object, contents,
4660 ((struct multiple_value *) lheader)-> 4660 XMULTIPLE_VALUE (obj)->allocated_count);
4661 allocated_count);
4662 } 4661 }
4663 4662
4664 static const struct memory_description multiple_value_description[] = { 4663 static const struct memory_description multiple_value_description[] = {
4665 { XD_LONG, offsetof (struct multiple_value, count) }, 4664 { XD_LONG, offsetof (struct multiple_value, count) },
4666 { XD_ELEMCOUNT, offsetof (struct multiple_value, allocated_count) }, 4665 { XD_ELEMCOUNT, offsetof (struct multiple_value, allocated_count) },
4668 { XD_LISP_OBJECT_ARRAY, offsetof (struct multiple_value, contents), 4667 { XD_LISP_OBJECT_ARRAY, offsetof (struct multiple_value, contents),
4669 XD_INDIRECT (1, 0) }, 4668 XD_INDIRECT (1, 0) },
4670 { XD_END } 4669 { XD_END }
4671 }; 4670 };
4672 4671
4673 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("multiple-value", multiple_value, 4672 DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT ("multiple-value", multiple_value,
4674 1, /*dumpable-flag*/ 4673 mark_multiple_value,
4675 mark_multiple_value, 4674 print_multiple_value, 0,
4676 print_multiple_value, 0, 4675 0, /* No equal method. */
4677 0, /* No equal method. */ 4676 0, /* No hash method. */
4678 0, /* No hash method. */ 4677 multiple_value_description,
4679 multiple_value_description, 4678 size_multiple_value,
4680 size_multiple_value, 4679 struct multiple_value);
4681 struct multiple_value);
4682 4680
4683 /* Given that FIRST and UPPER are the inclusive lower and exclusive upper 4681 /* Given that FIRST and UPPER are the inclusive lower and exclusive upper
4684 bounds for the multiple values we're interested in, modify (or don't) the 4682 bounds for the multiple values we're interested in, modify (or don't) the
4685 special variables used to indicate this to #'values and #'values-list. 4683 special variables used to indicate this to #'values and #'values-list.
4686 Returns the specpdl_depth() value before any modification. */ 4684 Returns the specpdl_depth() value before any modification. */
7264 /************************************************************************/ 7262 /************************************************************************/
7265 7263
7266 void 7264 void
7267 syms_of_eval (void) 7265 syms_of_eval (void)
7268 { 7266 {
7269 INIT_LRECORD_IMPLEMENTATION (subr); 7267 INIT_LISP_OBJECT (subr);
7270 INIT_LRECORD_IMPLEMENTATION (multiple_value); 7268 INIT_LISP_OBJECT (multiple_value);
7271 7269
7272 DEFSYMBOL (Qinhibit_quit); 7270 DEFSYMBOL (Qinhibit_quit);
7273 DEFSYMBOL (Qautoload); 7271 DEFSYMBOL (Qautoload);
7274 DEFSYMBOL (Qdebug_on_error); 7272 DEFSYMBOL (Qdebug_on_error);
7275 DEFSYMBOL (Qstack_trace_on_error); 7273 DEFSYMBOL (Qstack_trace_on_error);