Mercurial > hg > xemacs-beta
diff src/lisp.h @ 858:2c12fe2da451
[xemacs-hg @ 2002-05-31 09:38:45 by michaels]
2002-05-28 Martin Köbele <mkoebele@mkoebele.de>, Jens Müller <jmueller@informatik.uni-tuebingen.de>
* lrecord.h (lrecord_type): Add lrecord_type_weak_box to
lrecord_type enumeration.
* alloc.c (garbage_collect_1): Call prune_weak_boxes().
* lisp.h (struct weak_box):
* data.c:
(prune_weak_boxes):
(mark_weak_box):
(print_weak_box):
(weak_box_equal):
(weak_box_hash):
(make_weak_box):
(Fmake_weak_box):
(Fweak_box_ref):
(Fweak_boxp):
(syms_of_data):
(vars_of_data): Add implementation of weak boxes.
author | michaels |
---|---|
date | Fri, 31 May 2002 09:38:49 +0000 |
parents | 2b6fa2618f76 |
children | 804517e16990 |
line wrap: on
line diff
--- a/src/lisp.h Fri May 31 07:14:52 2002 +0000 +++ b/src/lisp.h Fri May 31 09:38:49 2002 +0000 @@ -2549,6 +2549,29 @@ Lisp_Object value, Error_Behavior errb)); +/*---------------------------- weak boxes ------------------------------*/ + +struct weak_box +{ + struct lcrecord_header header; + Lisp_Object value; + + Lisp_Object next_weak_box; /* don't mark through this! */ +}; + +void prune_weak_boxes (void); +Lisp_Object make_weak_box (Lisp_Object value); +Lisp_Object weak_box_ref (Lisp_Object value); + +DECLARE_LRECORD (weak_box, struct weak_box); +#define XWEAK_BOX(x) XRECORD (x, weak_box, struct weak_box) +#define XSET_WEAK_BOX(x, v) (XWEAK_BOX (x)->value = (v)) +#define wrap_weak_box(p) wrap_record (p, weak_box) +#define WEAK_BOXP(x) RECORDP (x, weak_box) +#define CHECK_WEAK_BOX(x) CHECK_RECORD (x, weak_box) +#define CONCHECK_WEAK_BOX(x) CONCHECK_RECORD (x, weak_box) + + /*---------------------------- weak lists ------------------------------*/ enum weak_list_type