From 42e8c96aa4e4d2cf3ba82751fcc0487e7e8a0225 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Mar 2011 18:28:18 -0800 Subject: [PATCH] fix stupid typo in Raindrops#size= Oops, it could give the GC problems. --- ext/raindrops/raindrops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/raindrops/raindrops.c b/ext/raindrops/raindrops.c index 1134920..7bd6f31 100644 --- a/ext/raindrops/raindrops.c +++ b/ext/raindrops/raindrops.c @@ -157,7 +157,7 @@ static void resize(struct raindrops *r, size_t new_rd_size) * we cannot use munmap + mmap to reallocate the buffer since it may * already be shared by other processes, so we just fail */ -static void resize(struct raindrops *r, size_t new_capa) +static void resize(struct raindrops *r, size_t new_rd_size) { rb_raise(rb_eRangeError, "mremap(2) is not available"); } @@ -173,15 +173,15 @@ static void resize(struct raindrops *r, size_t new_capa) */ static VALUE setsize(VALUE self, VALUE new_size) { - size_t new_capa = NUM2SIZET(new_size); + size_t new_rd_size = NUM2SIZET(new_size); struct raindrops *r = get(self); - if (new_capa <= r->capa) - r->size = new_capa; + if (new_rd_size <= r->capa) + r->size = new_rd_size; else - resize(r, new_capa); + resize(r, new_rd_size); - return new_capa; + return new_size; } /* -- 2.11.4.GIT