[前][次][番号順一覧][スレッド一覧]

ruby-changes:69169

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:21:06 +0900 (JST)
Subject: [ruby-changes:69169] 11599e5e1e (master): Add rb_darray_clear() for Kevin. Fix some warnings.

https://git.ruby-lang.org/ruby.git/commit/?id=11599e5e1e

From 11599e5e1ebed485089a994753a9c3c79416c037 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Thu, 9 Sep 2021 15:35:47 -0400
Subject: Add rb_darray_clear() for Kevin. Fix some warnings.

---
 darray.h       | 5 +++++
 yjit_codegen.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/darray.h b/darray.h
index b613d08489..ed6085fbcd 100644
--- a/darray.h
+++ b/darray.h
@@ -84,6 +84,11 @@ https://github.com/ruby/ruby/blob/trunk/darray.h#L84
 //
 #define rb_darray_make(ptr_to_ary, size) rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0]))
 
+// Set the size of the array to zero without freeing the backing memory.
+// Allows reusing the same array.
+//
+#define rb_darray_clear(ary) (ary->meta.size = 0)
+
 typedef struct rb_darray_meta {
     int32_t size;
     int32_t capa;
diff --git a/yjit_codegen.c b/yjit_codegen.c
index e99cc2622e..015e97bb73 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -142,6 +142,7 @@ jit_peek_at_self(jitstate_t *jit, ctx_t *ctx) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L142
     return jit->ec->cfp->self;
 }
 
+RBIMPL_ATTR_MAYBE_UNUSED()
 static VALUE
 jit_peek_at_local(jitstate_t *jit, ctx_t *ctx, int n)
 {
@@ -986,7 +987,7 @@ gen_expandarray(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L987
 
     // num is the number of requested values. If there aren't enough in the
     // array then we're going to push on nils.
-    rb_num_t num = (rb_num_t) jit_get_arg(jit, 0);
+    int num = (int)jit_get_arg(jit, 0);
     val_type_t array_type = ctx_get_opnd_type(ctx, OPND_STACK(0));
     x86opnd_t array_opnd = ctx_stack_pop(ctx, 1);
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]