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
2f8b0f66
Commit
2f8b0f66
authored
9 years ago
by
furunkel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move MRB_GC_ARENA_SIZE to gc.h and fix compiler warnings
parent
5c093ed2
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
include/mruby.h
include/mruby.h
+0
-4
include/mruby/gc.h
include/mruby/gc.h
+5
-1
src/gc.c
src/gc.c
+2
-2
No files found.
include/mruby.h
View file @
2f8b0f66
...
...
@@ -65,10 +65,6 @@ struct mrb_state;
*/
typedef
void
*
(
*
mrb_allocf
)
(
struct
mrb_state
*
mrb
,
void
*
,
size_t
,
void
*
ud
);
#ifndef MRB_GC_ARENA_SIZE
#define MRB_GC_ARENA_SIZE 100
#endif
#ifndef MRB_FIXED_STATE_ATEXIT_STACK_SIZE
#define MRB_FIXED_STATE_ATEXIT_STACK_SIZE 5
#endif
...
...
This diff is collapsed.
Click to expand it.
include/mruby/gc.h
View file @
2f8b0f66
...
...
@@ -30,6 +30,10 @@ MRB_API void mrb_free_context(struct mrb_state *mrb, struct mrb_context *c);
#define MRB_GC_WHITES (MRB_GC_WHITE_A | MRB_GC_WHITE_B)
#define MRB_GC_COLOR_MASK 7
#ifndef MRB_GC_ARENA_SIZE
#define MRB_GC_ARENA_SIZE 100
#endif
typedef
enum
{
GC_STATE_ROOT
=
0
,
GC_STATE_MARK
,
...
...
@@ -75,7 +79,7 @@ typedef struct mrb_gc {
}
mrb_gc
;
MRB_API
mrb_bool
mrb_object_dead_p
(
struct
mrb_state
*
mrb
,
struct
R
Object
*
object
);
mrb_object_dead_p
(
struct
mrb_state
*
mrb
,
struct
R
Basic
*
object
);
MRB_END_DECL
...
...
This diff is collapsed.
Click to expand it.
src/gc.c
View file @
2f8b0f66
...
...
@@ -260,7 +260,7 @@ mrb_free(mrb_state *mrb, void *p)
}
MRB_API
mrb_bool
mrb_object_dead_p
(
mrb_state
*
mrb
,
struct
R
Object
*
object
)
{
mrb_object_dead_p
(
mrb_state
*
mrb
,
struct
R
Basic
*
object
)
{
return
is_dead
(
&
mrb
->
gc
,
object
);
}
...
...
@@ -394,7 +394,7 @@ gc_protect(mrb_state *mrb, mrb_gc *gc, struct RBasic *p)
if
(
gc
->
arena_idx
>=
MRB_GC_ARENA_SIZE
)
{
/* arena overflow error */
gc
->
arena_idx
=
MRB_GC_ARENA_SIZE
-
4
;
/* force room in arena */
mrb_raise
(
gc
,
E_RUNTIME_ERROR
,
"arena overflow error"
);
mrb_raise
(
mrb
,
E_RUNTIME_ERROR
,
"arena overflow error"
);
}
#else
if
(
gc
->
arena_idx
>=
gc
->
arena_capa
)
{
...
...
This diff is collapsed.
Click to expand it.
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