Make variation_count an unsigned char
Since SHAPE_MAX_VARIATIONS is 8, it can easily fit inside an unsigned char.
This commit is contained in:
parent
a468213917
commit
d86833e717
Notes:
git
2023-01-11 16:07:21 +00:00
@ -11,6 +11,7 @@
|
|||||||
#include "id_table.h" /* for struct rb_id_table */
|
#include "id_table.h" /* for struct rb_id_table */
|
||||||
#include "internal/gc.h" /* for RB_OBJ_WRITE */
|
#include "internal/gc.h" /* for RB_OBJ_WRITE */
|
||||||
#include "internal/serial.h" /* for rb_serial_t */
|
#include "internal/serial.h" /* for rb_serial_t */
|
||||||
|
#include "internal/static_assert.h"
|
||||||
#include "ruby/internal/stdbool.h" /* for bool */
|
#include "ruby/internal/stdbool.h" /* for bool */
|
||||||
#include "ruby/intern.h" /* for rb_alloc_func_t */
|
#include "ruby/intern.h" /* for rb_alloc_func_t */
|
||||||
#include "ruby/ruby.h" /* for struct RBasic */
|
#include "ruby/ruby.h" /* for struct RBasic */
|
||||||
@ -25,6 +26,7 @@ struct rb_subclass_entry {
|
|||||||
struct rb_subclass_entry *next;
|
struct rb_subclass_entry *next;
|
||||||
struct rb_subclass_entry *prev;
|
struct rb_subclass_entry *prev;
|
||||||
};
|
};
|
||||||
|
typedef struct rb_subclass_entry rb_subclass_entry_t;
|
||||||
|
|
||||||
struct rb_cvar_class_tbl_entry {
|
struct rb_cvar_class_tbl_entry {
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
@ -52,12 +54,15 @@ struct rb_classext_struct {
|
|||||||
const VALUE refined_class;
|
const VALUE refined_class;
|
||||||
rb_alloc_func_t allocator;
|
rb_alloc_func_t allocator;
|
||||||
const VALUE includer;
|
const VALUE includer;
|
||||||
uint32_t max_iv_count;
|
|
||||||
uint32_t variation_count;
|
|
||||||
#if !SHAPE_IN_BASIC_FLAGS
|
#if !SHAPE_IN_BASIC_FLAGS
|
||||||
shape_id_t shape_id;
|
shape_id_t shape_id;
|
||||||
#endif
|
#endif
|
||||||
|
uint32_t max_iv_count;
|
||||||
|
unsigned char variation_count;
|
||||||
};
|
};
|
||||||
|
typedef struct rb_classext_struct rb_classext_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT(shape_max_variations, SHAPE_MAX_VARIATIONS < (1 << (sizeof(((rb_classext_t *)0)->variation_count) * CHAR_BIT)));
|
||||||
|
|
||||||
struct RClass {
|
struct RClass {
|
||||||
struct RBasic basic;
|
struct RBasic basic;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user