diff runtime/object.h @ 63:04baa003de5a

Merged latest changes with better C branch
author Mike Pavone <pavone@retrodev.com>
date Wed, 05 May 2010 22:12:23 -0400
parents b218af069da7 70af7fa155d0
children d4b44ae2e34a
line wrap: on
line diff
--- a/runtime/object.h	Sat Oct 10 16:43:37 2009 -0400
+++ b/runtime/object.h	Wed May 05 22:12:23 2010 -0400
@@ -27,14 +27,14 @@
 	uint32_t       last_convertto;
 	uint32_t       first_convertfrom;
 	uint32_t       last_convertfrom;
-	uint32_t       size;
-	uint32_t       boxed_size;
+	int32_t       size;
+	int32_t       boxed_size;
 } blueprint;
 
-typedef struct object {
+struct object {
 	rh_atomic32(refcount);
 	blueprint  *bprint;
-} object;
+};
 
 typedef struct {
 	object    base;
@@ -48,13 +48,13 @@
 	uint16_t 		num_params;
 	uint16_t 		resume;
 	uint32_t 		func;
-} calldata;
+};
 #pragma pack(pop)
 
-#define OBegin typedef struct { object header;
-#define Object(name) } t_ ## name;
-
-#define MOBegin typedef struct { multisize header;
+#define OBegin typedef struct {
+#define Object(name) } nt_ ## name; typedef struct { object SP_header; nt_ ## name payload; } t_ ## name;
+#define MObject(name) } nt_ ## name; typedef struct { multisize SP_header; nt_ ## name payload; } t_ ## name; 
+#define Box(nakedtype,fieldname,objectname) typedef struct{ object SP_header; nakedtype fieldname; } t_ ## objectname;
 
 #define get_blueprint(object) (object)->bprint
 
@@ -69,8 +69,8 @@
 object * new_object_bp(blueprint * bp);
 multisize * new_multisize(uint32_t type, uint32_t size);
 void release_ref(object * obj);
-blueprint * register_type_byid(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup);
-blueprint * new_blueprint(uint32_t type, uint32_t size, special_func init, special_func copy, special_func cleanup);
+blueprint * register_type_byid(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup);
+blueprint * new_blueprint(uint32_t type, int32_t size, special_func init, special_func copy, special_func cleanup);
 void add_method(blueprint * bp, uint32_t methodid, rhope_func impl);
 void add_getter(blueprint * bp, uint32_t fieldid, rhope_func impl);
 void add_setter(blueprint * bp, uint32_t fieldid, rhope_func impl);