Skip to content

Commit 879cda9

Browse files
Remove dependancy of vm_core.h on shape.h
so that now shape can happily include gc.h
1 parent d91a828 commit 879cda9

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

internal/gc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ struct rb_objspace; /* in vm_core.h */
132132
# undef RB_NEWOBJ_OF
133133
#endif
134134

135-
#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
136-
137135
#define RB_RVARGC_NEWOBJ_OF(var, T, c, f, s) \
138136
T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
139137
rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED, s) : \

iseq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
1212
**********************************************************************/
1313
#include "internal/gc.h"
14+
#include "shape.h"
1415
#include "vm_core.h"
1516

1617
RUBY_EXTERN const int ruby_api_version[];
@@ -325,6 +326,8 @@ VALUE rb_iseq_defined_string(enum defined_type type);
325326
/* vm.c */
326327
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
327328

329+
attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
330+
328331
RUBY_SYMBOL_EXPORT_END
329332

330333
#endif /* RUBY_ISEQ_H */

ractor_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "internal/gc.h"
12
#include "ruby/ruby.h"
23
#include "ruby/ractor.h"
34
#include "vm_core.h"

variable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/* per-object */
1212

13+
#include "shape.h"
14+
1315
struct gen_ivtbl {
1416
#if !SHAPE_IN_BASIC_FLAGS
1517
uint16_t shape_id;
@@ -20,7 +22,6 @@ struct gen_ivtbl {
2022

2123
int rb_ivar_generic_ivtbl_lookup(VALUE obj, struct gen_ivtbl **);
2224

23-
#include "shape.h"
2425
#if !SHAPE_IN_BASIC_FLAGS
2526
shape_id_t rb_generic_shape_id(VALUE obj);
2627
#endif

vm_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353

5454
#include "ruby_assert.h"
5555

56+
#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
57+
5658
#if VM_CHECK_MODE > 0
5759
#define VM_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr)
5860
#define VM_UNREACHABLE(func) rb_bug(#func ": unreachable")
@@ -100,7 +102,6 @@ extern int ruby_assert_critical_section_entered;
100102
#include "ruby/st.h"
101103
#include "ruby_atomic.h"
102104
#include "vm_opts.h"
103-
#include "shape.h"
104105

105106
#include "ruby/thread_native.h"
106107

@@ -1122,7 +1123,6 @@ rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_call
11221123

11231124
VALUE rb_iseq_disasm(const rb_iseq_t *iseq);
11241125
int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child);
1125-
attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
11261126

11271127
VALUE rb_iseq_coverage(const rb_iseq_t *iseq);
11281128

0 commit comments

Comments
 (0)