ruby-changes:66094
From: Peter <ko1@a...>
Date: Fri, 7 May 2021 01:55:02 +0900 (JST)
Subject: [ruby-changes:66094] 578e6416e7 (master): lldb: convert heap_page_obj_limit from a float to int
https://git.ruby-lang.org/ruby.git/commit/?id=578e6416e7 From 578e6416e71bcd5401bba63e9f3ef25a28258d9a Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Thu, 6 May 2021 15:51:47 +0000 Subject: lldb: convert heap_page_obj_limit from a float to int --- misc/lldb_cruby.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py index d169371..fa69a9b 100755 --- a/misc/lldb_cruby.py +++ b/misc/lldb_cruby.py @@ -545,12 +545,9 @@ class HeapPageIter: https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L545 def is_valid(self): heap_page_header_size = self.target.FindFirstType("struct heap_page_header").GetByteSize() rvalue_size = self.tRValue.GetByteSize() - heap_page_obj_limit = (HEAP_PAGE_SIZE - heap_page_header_size)/rvalue_size + heap_page_obj_limit = int((HEAP_PAGE_SIZE - heap_page_header_size) / rvalue_size) - if (self.num_slots > heap_page_obj_limit) or (self.num_slots < heap_page_obj_limit - 1): - return False - else: - return True + return (heap_page_obj_limit - 1) <= self.num_slots <= heap_page_obj_limit def __iter__(self): return self -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/