summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-01 11:48:42 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-01 11:48:42 +0000
commit780a125faf79ae986efe709b53304cfb7e46d964 (patch)
tree9a8fc8b80e0fca2fb8b2c46c99605fd13928d425
parent0ade4f39fd94b8294c66fb706f22f425f1e833c8 (diff)
* bignum.c (power_cache_get_power): Hide cached Bignum objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 417c456..7acde96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Aug 1 20:46:29 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (power_cache_get_power): Hide cached Bignum objects.
+
Thu Aug 1 19:15:05 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (rb_big2str1): Remove non-trim mode.
diff --git a/bignum.c b/bignum.c
index 3bb77ac..c8de1fa 100644
--- a/bignum.c
+++ b/bignum.c
@@ -4151,6 +4151,7 @@ power_cache_get_power(int base, int power_level, size_t *numdigits_ret)
power = bigsq(power_cache_get_power(base, power_level - 1, &numdigits));
numdigits *= 2;
}
+ rb_obj_hide(power);
big2str_power_cache[base - 2][power_level] = power;
big2str_numdigits_cache[base - 2][power_level] = numdigits;
rb_gc_register_mark_object(power);