From ba09129398970fd47733859fa603960ba0618fbc Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 26 Nov 2021 08:44:37 +0100 Subject: [PATCH] Berry renumber internal types to allow for extensions --- lib/libesp32/Berry/src/be_gc.h | 2 -- lib/libesp32/Berry/src/be_object.h | 20 ++++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/libesp32/Berry/src/be_gc.h b/lib/libesp32/Berry/src/be_gc.h index e22903ef9..0e0ce9e82 100644 --- a/lib/libesp32/Berry/src/be_gc.h +++ b/lib/libesp32/Berry/src/be_gc.h @@ -10,8 +10,6 @@ #include "be_object.h" -#define BE_GCOBJECT BE_STRING - #define gc_object(o) cast(bgcobject*, o) #define gc_cast(o, t, T) ((o) && (o)->type == (t) ? (T*)(o) : NULL) #define cast_proto(o) gc_cast(o, BE_PROTO, bproto) diff --git a/lib/libesp32/Berry/src/be_object.h b/lib/libesp32/Berry/src/be_object.h index 4c8cbf1ab..e19d766d6 100644 --- a/lib/libesp32/Berry/src/be_object.h +++ b/lib/libesp32/Berry/src/be_object.h @@ -19,14 +19,18 @@ #define BE_COMPTR 5 /* common pointer */ #define BE_INDEX 6 /* index for instance variable, previously BE_INT */ #define BE_FUNCTION 7 -#define BE_STRING 8 /* from this type can be gced, see BE_GCOBJECT */ -#define BE_CLASS 9 -#define BE_INSTANCE 10 -#define BE_PROTO 11 -#define BE_LIST 12 -#define BE_MAP 13 -#define BE_MODULE 14 -#define BE_COMOBJ 15 /* common object */ + +#define BE_GCOBJECT 16 /* from this type can be gced */ + +#define BE_STRING 16 +#define BE_CLASS 17 +#define BE_INSTANCE 18 +#define BE_PROTO 19 +#define BE_LIST 20 +#define BE_MAP 21 +#define BE_MODULE 22 +#define BE_COMOBJ 23 /* common object */ + #define BE_NTVFUNC ((0 << 5) | BE_FUNCTION) #define BE_CLOSURE ((1 << 5) | BE_FUNCTION) #define BE_NTVCLOS ((2 << 5) | BE_FUNCTION)