Changed the object_count so that it only iterates over the RBasic object, not the full RVALUE known by the GC

This commit is contained in:
Ryan Scott
2013-05-17 07:41:13 +10:00
parent 222918deae
commit f62cc5b1ee
4 changed files with 52 additions and 38 deletions
+2 -31
View File
@@ -12,38 +12,9 @@ extern "C" {
#endif
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/data.h"
#include "mruby/hash.h"
#include "mruby/proc.h"
#include "mruby/range.h"
#include "mruby/string.h"
#include "mruby/variable.h"
#include "mruby/value.h"
struct free_obj {
MRB_OBJECT_HEADER;
struct RBasic *next;
};
struct RVALUE {
union {
struct free_obj free;
struct RBasic basic;
struct RObject object;
struct RClass klass;
struct RString string;
struct RArray array;
struct RHash hash;
struct RRange range;
struct RData data;
struct RProc proc;
} as;
};
typedef struct RVALUE RVALUE;
typedef int each_object_callback(RVALUE *obj, void *data);
typedef int each_object_callback(mrb_state *mrb, struct RBasic obj, void *data);
void mrb_objspace_each_objects(mrb_state *mrb, each_object_callback* callback, void *data);
#if defined(__cplusplus)