Skip to content

Commit c1f7039

Browse files
committed
Remove rb_imemo_tmpbuf_set_ptr
1 parent 3aa8927 commit c1f7039

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

internal/imemo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
139139
static inline bool imemo_throw_data_p(VALUE imemo);
140140
static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data);
141141
static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v);
142-
static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr);
143142
static inline void MEMO_V1_SET(struct MEMO *m, VALUE v);
144143
static inline void MEMO_V2_SET(struct MEMO *m, VALUE v);
145144

@@ -193,12 +192,6 @@ RB_IMEMO_TMPBUF_PTR(VALUE v)
193192
return p->ptr;
194193
}
195194

196-
static inline void *
197-
rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
198-
{
199-
return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
200-
}
201-
202195
static inline VALUE
203196
rb_imemo_tmpbuf_new_from_an_RString(VALUE str)
204197
{

process.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,9 +2726,7 @@ open_func(void *ptr)
27262726
static void
27272727
rb_execarg_allocate_dup2_tmpbuf(struct rb_execarg *eargp, long len)
27282728
{
2729-
VALUE tmpbuf = rb_imemo_tmpbuf_new();
2730-
rb_imemo_tmpbuf_set_ptr(tmpbuf, ruby_xmalloc(run_exec_dup2_tmpbuf_size(len)));
2731-
eargp->dup2_tmpbuf = tmpbuf;
2729+
rb_alloc_tmp_buffer(&eargp->dup2_tmpbuf, run_exec_dup2_tmpbuf_size(len));
27322730
}
27332731

27342732
static VALUE
@@ -3183,8 +3181,7 @@ run_exec_dup2(VALUE ary, VALUE tmpbuf, struct rb_execarg *sargp, char *errmsg, s
31833181
long n, i;
31843182
int ret;
31853183
int extra_fd = -1;
3186-
struct rb_imemo_tmpbuf_struct *buf = (void *)tmpbuf;
3187-
struct run_exec_dup2_fd_pair *pairs = (void *)buf->ptr;
3184+
struct run_exec_dup2_fd_pair *pairs = RB_IMEMO_TMPBUF_PTR(tmpbuf);
31883185

31893186
n = RARRAY_LEN(ary);
31903187

0 commit comments

Comments
 (0)