Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
88483fad
Commit
88483fad
authored
Mar 15, 2013
by
Yukihiro Matz Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename mrb_basic to mrb_basic_ptr; close #1011
parent
24366930
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
19 deletions
+21
-19
include/mruby.h
include/mruby.h
+2
-2
include/mruby/value.h
include/mruby/value.h
+3
-1
src/class.c
src/class.c
+1
-1
src/gc.c
src/gc.c
+14
-14
src/kernel.c
src/kernel.c
+1
-1
No files found.
include/mruby.h
View file @
88483fad
...
...
@@ -232,11 +232,11 @@ int mrb_gc_arena_save(mrb_state*);
void
mrb_gc_arena_restore
(
mrb_state
*
,
int
);
void
mrb_gc_mark
(
mrb_state
*
,
struct
RBasic
*
);
#define mrb_gc_mark_value(mrb,val) do {\
if (mrb_type(val) >= MRB_TT_OBJECT) mrb_gc_mark((mrb), mrb_basic(val));\
if (mrb_type(val) >= MRB_TT_OBJECT) mrb_gc_mark((mrb), mrb_basic
_ptr
(val));\
} while (0)
void
mrb_field_write_barrier
(
mrb_state
*
,
struct
RBasic
*
,
struct
RBasic
*
);
#define mrb_field_write_barrier_value(mrb, obj, val) do{\
if ((val.tt >= MRB_TT_OBJECT)) mrb_field_write_barrier((mrb), (obj), mrb_basic(val));\
if ((val.tt >= MRB_TT_OBJECT)) mrb_field_write_barrier((mrb), (obj), mrb_basic
_ptr
(val));\
} while (0)
void
mrb_write_barrier
(
mrb_state
*
,
struct
RBasic
*
);
...
...
include/mruby/value.h
View file @
88483fad
...
...
@@ -186,7 +186,9 @@ struct RBasic {
MRB_OBJECT_HEADER
;
};
#define mrb_basic(v) ((struct RBasic*)((v).value.p))
#define mrb_basic_ptr(v) ((struct RBasic*)((v).value.p))
/* obsolete macro mrb_basic; will be removed soon */
#define mrb_basic(v) mrb_basic_ptr(v)
struct
RObject
{
MRB_OBJECT_HEADER
;
...
...
src/class.c
View file @
88483fad
...
...
@@ -921,7 +921,7 @@ mrb_singleton_class(mrb_state *mrb, mrb_value v)
default:
break
;
}
obj
=
mrb_basic
(
v
);
obj
=
mrb_basic
_ptr
(
v
);
prepare_singleton_class
(
mrb
,
obj
);
return
mrb_obj_value
(
obj
->
c
);
}
...
...
src/gc.c
View file @
88483fad
...
...
@@ -322,7 +322,7 @@ void
mrb_gc_protect
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
if
(
mrb_special_const_p
(
obj
))
return
;
gc_protect
(
mrb
,
mrb_basic
(
obj
));
gc_protect
(
mrb
,
mrb_basic
_ptr
(
obj
));
}
struct
RBasic
*
...
...
@@ -1168,8 +1168,8 @@ test_mrb_field_write_barrier(void)
puts
(
"test_mrb_field_write_barrier"
);
mrb
->
is_generational_gc_mode
=
FALSE
;
obj
=
mrb_basic
(
mrb_ary_new
(
mrb
));
value
=
mrb_basic
(
mrb_str_new_cstr
(
mrb
,
"value"
));
obj
=
mrb_basic
_ptr
(
mrb_ary_new
(
mrb
));
value
=
mrb_basic
_ptr
(
mrb_str_new_cstr
(
mrb
,
"value"
));
paint_black
(
obj
);
paint_partial_white
(
mrb
,
value
);
...
...
@@ -1210,15 +1210,15 @@ test_mrb_field_write_barrier(void)
{
puts
(
"test_mrb_field_write_barrier_value"
);
obj
=
mrb_basic
(
mrb_ary_new
(
mrb
));
obj
=
mrb_basic
_ptr
(
mrb_ary_new
(
mrb
));
mrb_value
value
=
mrb_str_new_cstr
(
mrb
,
"value"
);
paint_black
(
obj
);
paint_partial_white
(
mrb
,
mrb_basic
(
value
));
paint_partial_white
(
mrb
,
mrb_basic
_ptr
(
value
));
mrb
->
gc_state
=
GC_STATE_MARK
;
mrb_field_write_barrier_value
(
mrb
,
obj
,
value
);
gc_assert
(
is_gray
(
mrb_basic
(
value
)));
gc_assert
(
is_gray
(
mrb_basic
_ptr
(
value
)));
}
mrb_close
(
mrb
);
...
...
@@ -1231,7 +1231,7 @@ test_mrb_write_barrier(void)
struct
RBasic
*
obj
;
puts
(
"test_mrb_write_barrier"
);
obj
=
mrb_basic
(
mrb_ary_new
(
mrb
));
obj
=
mrb_basic
_ptr
(
mrb_ary_new
(
mrb
));
paint_black
(
obj
);
puts
(
" in GC_STATE_MARK"
);
...
...
@@ -1260,12 +1260,12 @@ test_add_gray_list(void)
puts
(
"test_add_gray_list"
);
change_gen_gc_mode
(
mrb
,
FALSE
);
gc_assert
(
mrb
->
gray_list
==
NULL
);
obj1
=
mrb_basic
(
mrb_str_new_cstr
(
mrb
,
"test"
));
obj1
=
mrb_basic
_ptr
(
mrb_str_new_cstr
(
mrb
,
"test"
));
add_gray_list
(
mrb
,
obj1
);
gc_assert
(
mrb
->
gray_list
==
obj1
);
gc_assert
(
is_gray
(
obj1
));
obj2
=
mrb_basic
(
mrb_str_new_cstr
(
mrb
,
"test"
));
obj2
=
mrb_basic
_ptr
(
mrb_str_new_cstr
(
mrb
,
"test"
));
add_gray_list
(
mrb
,
obj2
);
gc_assert
(
mrb
->
gray_list
==
obj2
);
gc_assert
(
mrb
->
gray_list
->
gcnext
==
obj1
);
...
...
@@ -1294,12 +1294,12 @@ test_gc_gray_mark(void)
puts
(
" in MRB_TT_ARRAY"
);
obj_v
=
mrb_ary_new
(
mrb
);
value_v
=
mrb_str_new_cstr
(
mrb
,
"test"
);
paint_gray
(
mrb_basic
(
obj_v
));
paint_partial_white
(
mrb
,
mrb_basic
(
value_v
));
paint_gray
(
mrb_basic
_ptr
(
obj_v
));
paint_partial_white
(
mrb
,
mrb_basic
_ptr
(
value_v
));
mrb_ary_push
(
mrb
,
obj_v
,
value_v
);
gray_num
=
gc_gray_mark
(
mrb
,
mrb_basic
(
obj_v
));
gc_assert
(
is_black
(
mrb_basic
(
obj_v
)));
gc_assert
(
is_gray
(
mrb_basic
(
value_v
)));
gray_num
=
gc_gray_mark
(
mrb
,
mrb_basic
_ptr
(
obj_v
));
gc_assert
(
is_black
(
mrb_basic
_ptr
(
obj_v
)));
gc_assert
(
is_gray
(
mrb_basic
_ptr
(
value_v
)));
gc_assert
(
gray_num
==
1
);
mrb_close
(
mrb
);
...
...
src/kernel.c
View file @
88483fad
...
...
@@ -263,7 +263,7 @@ mrb_obj_class_m(mrb_state *mrb, mrb_value self)
struct
RClass
*
mrb_singleton_class_clone
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
struct
RClass
*
klass
=
mrb_basic
(
obj
)
->
c
;
struct
RClass
*
klass
=
mrb_basic
_ptr
(
obj
)
->
c
;
if
(
klass
->
tt
!=
MRB_TT_SCLASS
)
return
klass
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment