Commit 4c4cf0a4 authored by mattn's avatar mattn

Pluggable Struct

parent fbe04176
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "mruby/hash.h" #include "mruby/hash.h"
#include "mruby/range.h" #include "mruby/range.h"
#include <string.h> #include <string.h>
#include "mruby/struct.h"
#include "mruby/proc.h" #include "mruby/proc.h"
#include "mruby/data.h" #include "mruby/data.h"
#include "mruby/variable.h" #include "mruby/variable.h"
...@@ -86,9 +85,6 @@ typedef struct { ...@@ -86,9 +85,6 @@ typedef struct {
struct RArray array; struct RArray array;
struct RHash hash; struct RHash hash;
struct RRange range; struct RRange range;
#ifdef ENABLE_STRUCT
struct RStruct strct;
#endif
struct RData data; struct RData data;
struct RProc proc; struct RProc proc;
} as; } as;
...@@ -455,18 +451,6 @@ gc_mark_children(mrb_state *mrb, struct RBasic *obj) ...@@ -455,18 +451,6 @@ gc_mark_children(mrb_state *mrb, struct RBasic *obj)
} }
break; break;
#ifdef ENABLE_STRUCT
case MRB_TT_STRUCT:
{
struct RStruct *s = (struct RStruct*)obj;
long i;
for (i=0; i<s->len; i++){
mrb_gc_mark_value(mrb, s->ptr[i]);
}
}
break;
#endif
default: default:
break; break;
} }
...@@ -539,12 +523,6 @@ obj_free(mrb_state *mrb, struct RBasic *obj) ...@@ -539,12 +523,6 @@ obj_free(mrb_state *mrb, struct RBasic *obj)
mrb_free(mrb, ((struct RRange*)obj)->edges); mrb_free(mrb, ((struct RRange*)obj)->edges);
break; break;
#ifdef ENABLE_STRUCT
case MRB_TT_STRUCT:
mrb_free(mrb, ((struct RStruct*)obj)->ptr);
break;
#endif
case MRB_TT_DATA: case MRB_TT_DATA:
{ {
struct RData *d = (struct RData*)obj; struct RData *d = (struct RData*)obj;
...@@ -664,15 +642,6 @@ gc_gray_mark(mrb_state *mrb, struct RBasic *obj) ...@@ -664,15 +642,6 @@ gc_gray_mark(mrb_state *mrb, struct RBasic *obj)
children+=2; children+=2;
break; break;
#ifdef ENABLE_STRUCT
case MRB_TT_STRUCT:
{
struct RStruct *s = (struct RStruct*)obj;
children += s->len;
}
break;
#endif
default: default:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment