Repository: lucy-clownfish Updated Branches: refs/heads/master 5e2478048 -> f6035fad2
Make ivars offsets and sizes a uint32_t Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/f6035fad Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/f6035fad Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/f6035fad Branch: refs/heads/master Commit: f6035fad216984dc1096029481ead147f4f1b4d8 Parents: 25c561a Author: Nick Wellnhofer <[email protected]> Authored: Fri Apr 17 21:45:27 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Mon Jul 27 19:03:42 2015 +0200 ---------------------------------------------------------------------- compiler/src/CFCBindClass.c | 4 ++-- compiler/src/CFCBindCore.c | 2 +- compiler/src/CFCBindSpecs.c | 4 ++-- runtime/core/Clownfish/Class.c | 6 +++--- runtime/core/Clownfish/Class.cfh | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f6035fad/compiler/src/CFCBindClass.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCBindClass.c b/compiler/src/CFCBindClass.c index 70dd211..69acd22 100644 --- a/compiler/src/CFCBindClass.c +++ b/compiler/src/CFCBindClass.c @@ -164,7 +164,7 @@ S_ivars_func(CFCBindClass *self) { const char *full_offset = CFCClass_full_ivars_offset(client); const char *PREFIX = CFCClass_get_PREFIX(client); char pattern[] = - "extern size_t %s;\n" + "extern uint32_t %s;\n" "typedef struct %s %s;\n" "static CFISH_INLINE %s*\n" "%s(%s *self) {\n" @@ -312,7 +312,7 @@ CFCBindClass_to_c_data(CFCBindClass *self) { " * can be found.\n" " */\n" "\n" - "size_t %s;\n" + "uint32_t %s;\n" "\n" "/* Offsets for method pointers, measured in bytes, from the top\n" " * of this class's singleton object.\n" http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f6035fad/compiler/src/CFCBindCore.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCBindCore.c b/compiler/src/CFCBindCore.c index 5b20de8..5c8eae2 100644 --- a/compiler/src/CFCBindCore.c +++ b/compiler/src/CFCBindCore.c @@ -226,7 +226,7 @@ S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel) { " ((_full_meth ## _t)cfish_super_method(_class, \\\n" " _full_meth ## _OFFSET))\n" "\n" - "extern CFISH_VISIBLE size_t cfish_Class_offset_of_parent;\n" + "extern CFISH_VISIBLE uint32_t cfish_Class_offset_of_parent;\n" "static CFISH_INLINE cfish_method_t\n" "cfish_super_method(const void *klass, uint32_t offset) {\n" " char *class_as_char = (char*)klass;\n" http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f6035fad/compiler/src/CFCBindSpecs.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCBindSpecs.c b/compiler/src/CFCBindSpecs.c index 7c5c2a3..28da29c 100644 --- a/compiler/src/CFCBindSpecs.c +++ b/compiler/src/CFCBindSpecs.c @@ -124,8 +124,8 @@ CFCBindSpecs_get_typedefs() { " cfish_Class **klass;\n" " cfish_Class **parent;\n" " const char *name;\n" - " size_t ivars_size;\n" - " size_t *ivars_offset_ptr;\n" + " uint32_t ivars_size;\n" + " uint32_t *ivars_offset_ptr;\n" " uint32_t num_novel_meths;\n" " uint32_t num_overridden_meths;\n" " uint32_t num_inherited_meths;\n" http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f6035fad/runtime/core/Clownfish/Class.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Class.c b/runtime/core/Clownfish/Class.c index d2de1ff..d16c3b8 100644 --- a/runtime/core/Clownfish/Class.c +++ b/runtime/core/Clownfish/Class.c @@ -42,7 +42,7 @@ #define InheritedMethSpec cfish_InheritedMethSpec #define ClassSpec cfish_ClassSpec -size_t Class_offset_of_parent = offsetof(Class, parent); +uint32_t Class_offset_of_parent = offsetof(Class, parent); static void S_set_name(Class *self, const char *utf8, size_t size); @@ -109,7 +109,7 @@ Class_bootstrap(const cfish_ClassSpec *specs, size_t num_specs, Class *klass = *spec->klass; Class *parent = spec->parent ? *spec->parent : NULL; - size_t ivars_offset = 0; + uint32_t ivars_offset = 0; if (spec->ivars_offset_ptr != NULL) { if (parent) { Class *ancestor = parent; @@ -240,7 +240,7 @@ Class_Get_Parent_IMP(Class *self) { return self->parent; } -size_t +uint32_t Class_Get_Obj_Alloc_Size_IMP(Class *self) { return self->obj_alloc_size; } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f6035fad/runtime/core/Clownfish/Class.cfh ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh index 4a789eb..c32d316 100644 --- a/runtime/core/Clownfish/Class.cfh +++ b/runtime/core/Clownfish/Class.cfh @@ -30,12 +30,12 @@ final class Clownfish::Class inherits Clownfish::Obj { String *name_internal; uint32_t flags; int32_t parcel_id; - size_t obj_alloc_size; + uint32_t obj_alloc_size; uint32_t class_alloc_size; Method **methods; cfish_method_t[1] vtable; /* flexible array */ - inert size_t offset_of_parent; + inert uint32_t offset_of_parent; inert void bootstrap(const cfish_ClassSpec *specs, size_t num_specs, @@ -130,7 +130,7 @@ final class Clownfish::Class inherits Clownfish::Obj { Class* Get_Parent(Class *self); - size_t + uint32_t Get_Obj_Alloc_Size(Class *self); /** Return novel methods of the class.
