Skip to content

Commit e4f09a8

Browse files
committed
Remove next field and unused method from tmpbuf
These used to be used by the parser
1 parent 061f9b8 commit e4f09a8

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

imemo.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,6 @@ rb_free_tmp_buffer(volatile VALUE *store)
9494
}
9595
}
9696

97-
rb_imemo_tmpbuf_t *
98-
rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt)
99-
{
100-
rb_imemo_tmpbuf_t *tmpbuf = (rb_imemo_tmpbuf_t *)rb_imemo_tmpbuf_new();
101-
tmpbuf->ptr = buf;
102-
tmpbuf->next = old_heap;
103-
tmpbuf->cnt = cnt;
104-
105-
return tmpbuf;
106-
}
107-
10897
static VALUE
10998
imemo_fields_new(VALUE owner, size_t capa)
11099
{
@@ -478,9 +467,7 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating)
478467
const rb_imemo_tmpbuf_t *m = (const rb_imemo_tmpbuf_t *)obj;
479468

480469
if (!reference_updating) {
481-
do {
482-
rb_gc_mark_locations(m->ptr, m->ptr + m->cnt);
483-
} while ((m = m->next) != NULL);
470+
rb_gc_mark_locations(m->ptr, m->ptr + m->cnt);
484471
}
485472

486473
break;

internal/imemo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ struct vm_ifunc {
9494
struct rb_imemo_tmpbuf_struct {
9595
VALUE flags;
9696
VALUE *ptr; /* malloc'ed buffer */
97-
struct rb_imemo_tmpbuf_struct *next; /* next imemo */
9897
size_t cnt; /* buffer size in VALUE */
9998
};
10099

@@ -133,7 +132,6 @@ struct MEMO {
133132
typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
134133
#endif
135134
VALUE rb_imemo_tmpbuf_new(void);
136-
rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
137135
struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
138136
static inline enum imemo_type imemo_type(VALUE imemo);
139137
static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);

0 commit comments

Comments
 (0)