mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c: use 2 bits with unsigned int for rb_objspace:🎏:mode
because it always returns 0 to 2 (non-negative value). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
befcbc2cb9
commit
d04ee29e77
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Mar 4 19:19:42 2016 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c: use 2 bits with unsigned int for rb_objspace::flags::mode
|
||||
because it always returns 0 to 2 (non-negative value).
|
||||
|
||||
Fri Mar 4 18:42:08 2016 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c: rename "enum gc_stat" to "enum gc_mode"
|
||||
|
|
6
gc.c
6
gc.c
|
@ -490,7 +490,7 @@ typedef struct rb_objspace {
|
|||
} malloc_params;
|
||||
|
||||
struct {
|
||||
enum gc_mode mode : 3;
|
||||
unsigned int mode : 2;
|
||||
unsigned int immediate_sweep : 1;
|
||||
unsigned int dont_gc : 1;
|
||||
unsigned int dont_incremental : 1;
|
||||
|
@ -747,8 +747,8 @@ gc_mode_verify(enum gc_mode mode)
|
|||
return mode;
|
||||
}
|
||||
|
||||
#define gc_mode(objspace) gc_mode_verify((objspace)->flags.mode)
|
||||
#define gc_mode_set(objspace, mode) ((objspace)->flags.mode = gc_mode_verify(mode))
|
||||
#define gc_mode(objspace) gc_mode_verify((enum gc_mode)(objspace)->flags.mode)
|
||||
#define gc_mode_set(objspace, mode) ((objspace)->flags.mode = (unsigned int)gc_mode_verify(mode))
|
||||
|
||||
#define is_marking(objspace) (gc_mode(objspace) == gc_mode_marking)
|
||||
#define is_sweeping(objspace) (gc_mode(objspace) == gc_mode_sweeping)
|
||||
|
|
Loading…
Add table
Reference in a new issue