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

ruby-changes:72484

From: Nobuyoshi <ko1@a...>
Date: Sun, 10 Jul 2022 16:38:40 +0900 (JST)
Subject: [ruby-changes:72484] 51025a9013 (master): Use `size_t` for `rb_raw_obj_info`

https://git.ruby-lang.org/ruby.git/commit/?id=51025a9013

From 51025a901309eefa8ae81ff386bd078f14707b70 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 5 Jul 2022 22:39:08 +0900
Subject: Use `size_t` for `rb_raw_obj_info`

---
 gc.c | 6 +++---
 gc.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gc.c b/gc.c
index 2d8d26fcb2..3425061a64 100644
--- a/gc.c
+++ b/gc.c
@@ -13650,7 +13650,7 @@ rb_method_type_name(rb_method_type_t type) https://github.com/ruby/ruby/blob/trunk/gc.c#L13650
      FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
 
 static void
-rb_raw_iseq_info(char *buff, const int buff_size, const rb_iseq_t *iseq)
+rb_raw_iseq_info(char *const buff, const size_t buff_size, const rb_iseq_t *iseq)
 {
     if (buff_size > 0 && ISEQ_BODY(iseq) && ISEQ_BODY(iseq)->location.label && !RB_TYPE_P(ISEQ_BODY(iseq)->location.pathobj, T_MOVED)) {
 	VALUE path = rb_iseq_path(iseq);
@@ -13672,9 +13672,9 @@ str_len_no_raise(VALUE str) https://github.com/ruby/ruby/blob/trunk/gc.c#L13672
 }
 
 const char *
-rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
+rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj)
 {
-    int pos = 0;
+    size_t pos = 0;
     void *poisoned = asan_unpoison_object_temporary(obj);
 
 #define BUFF_ARGS buff + pos, buff_size - pos
diff --git a/gc.h b/gc.h
index 84c8eade63..a1f6e6e49d 100644
--- a/gc.h
+++ b/gc.h
@@ -112,7 +112,7 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr); https://github.com/ruby/ruby/blob/trunk/gc.h#L112
 #define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
 
 const char *rb_obj_info(VALUE obj);
-const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
+const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj);
 
 VALUE rb_gc_disable_no_rest(void);
 
-- 
cgit v1.2.1


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

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