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
6d75f89e
Commit
6d75f89e
authored
Apr 03, 2014
by
take_cheeze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support :T_FIBER in ObjectSpace.count_objects .
parent
09d1c423
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
mrbgems/mruby-objectspace/src/mruby_objectspace.c
mrbgems/mruby-objectspace/src/mruby_objectspace.c
+1
-0
mrbgems/mruby-objectspace/test/objectspace.rb
mrbgems/mruby-objectspace/test/objectspace.rb
+2
-0
No files found.
mrbgems/mruby-objectspace/src/mruby_objectspace.c
View file @
6d75f89e
...
...
@@ -90,6 +90,7 @@ os_count_objects(mrb_state *mrb, mrb_value self)
COUNT_TYPE
(
T_FILE
);
COUNT_TYPE
(
T_ENV
);
COUNT_TYPE
(
T_DATA
);
COUNT_TYPE
(
T_FIBER
);
#undef COUNT_TYPE
default:
type
=
mrb_fixnum_value
(
i
);
break
;
...
...
mrbgems/mruby-objectspace/test/objectspace.rb
View file @
6d75f89e
assert
(
'ObjectSpace.count_objects'
)
do
h
=
{}
f
=
Fiber
.
new
{}
if
Object
.
const_defined?
:Fiber
ObjectSpace
.
count_objects
(
h
)
assert_kind_of
(
Hash
,
h
)
assert_true
(
h
.
keys
.
all?
{
|
x
|
x
.
is_a?
(
Symbol
)
||
x
.
is_a?
(
Integer
)
})
...
...
@@ -7,6 +8,7 @@ assert('ObjectSpace.count_objects') do
assert_true
(
h
.
has_key?
(
:TOTAL
))
assert_true
(
h
.
has_key?
(
:FREE
))
assert_true
(
h
.
has_key?
(
:T_FIBER
))
if
Object
.
const_defined?
:Fiber
h
=
ObjectSpace
.
count_objects
assert_kind_of
(
Hash
,
h
)
...
...
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