diff --git a/extlib/benz/gc.c b/extlib/benz/gc.c index 878c500e..4651ff35 100644 --- a/extlib/benz/gc.c +++ b/extlib/benz/gc.c @@ -487,12 +487,6 @@ gc_mark_object(pic_state *pic, struct pic_object *obj) } break; } - case PIC_TT_BOX: { - struct pic_box *box = (struct pic_box *)obj; - - gc_mark(pic, box->value); - break; - } case PIC_TT_NIL: case PIC_TT_BOOL: #if PIC_ENABLE_FLOAT @@ -739,9 +733,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj) case PIC_TT_CP: { break; } - case PIC_TT_BOX: { - break; - } case PIC_TT_NIL: case PIC_TT_BOOL: #if PIC_ENABLE_FLOAT diff --git a/extlib/benz/include/picrin.h b/extlib/benz/include/picrin.h index 67b6f091..82429713 100644 --- a/extlib/benz/include/picrin.h +++ b/extlib/benz/include/picrin.h @@ -269,7 +269,6 @@ pic_value pic_fdisplay(pic_state *, pic_value, xFILE *); #include "picrin/symbol.h" #include "picrin/vector.h" #include "picrin/reg.h" -#include "picrin/box.h" #if defined(__cplusplus) } diff --git a/extlib/benz/include/picrin/box.h b/extlib/benz/include/picrin/box.h deleted file mode 100644 index edce0f0d..00000000 --- a/extlib/benz/include/picrin/box.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * See Copyright Notice in picrin.h - */ - -#ifndef PICRIN_BOX_H -#define PICRIN_BOX_H - -#if defined(__cplusplus) -extern "C" { -#endif - -struct pic_box { - PIC_OBJECT_HEADER - pic_value value; -}; - -#define pic_box_p(v) (pic_type(v) == PIC_TT_BOX) -#define pic_box_ptr(o) ((struct pic_box *)pic_ptr(o)) - -PIC_INLINE pic_value -pic_box(pic_state *pic, pic_value value) -{ - struct pic_box *box; - - box = (struct pic_box *)pic_obj_alloc(pic, sizeof(struct pic_box), PIC_TT_BOX); - box->value = value; - - return pic_obj_value(box); -} - -PIC_INLINE pic_value -pic_unbox(pic_state *pic, pic_value box) -{ - if (! pic_box_p(box)) { - pic_errorf(pic, "box required"); - } - return pic_box_ptr(box)->value; -} - -PIC_INLINE void -pic_set_box(pic_state *pic, pic_value box, pic_value value) -{ - if (! pic_box_p(box)) { - pic_errorf(pic, "box required"); - } - pic_box_ptr(box)->value = value; -} - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/extlib/benz/include/picrin/type.h b/extlib/benz/include/picrin/type.h index c5d5f4da..e824d9b1 100644 --- a/extlib/benz/include/picrin/type.h +++ b/extlib/benz/include/picrin/type.h @@ -163,11 +163,10 @@ enum pic_tt { PIC_TT_DATA, PIC_TT_DICT, PIC_TT_REG, - PIC_TT_BOX, PIC_TT_RECORD, PIC_TT_CXT, PIC_TT_IREP, - PIC_TT_CP, + PIC_TT_CP }; #define PIC_OBJECT_HEADER \ @@ -338,8 +337,6 @@ pic_type_repr(enum pic_tt tt) return "reg"; case PIC_TT_RECORD: return "record"; - case PIC_TT_BOX: - return "box"; case PIC_TT_CP: return "checkpoint"; }