about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-10 18:28:18 -0800
committerEric Wong <normalperson@yhbt.net>2011-03-10 18:28:18 -0800
commit42e8c96aa4e4d2cf3ba82751fcc0487e7e8a0225 (patch)
tree7478b6e3318275e93890b1ce7a5554a71ab6851b
parente87875ba261fa5b0cd328bcf03e666e2d9078114 (diff)
downloadraindrops-42e8c96aa4e4d2cf3ba82751fcc0487e7e8a0225.tar.gz
Oops, it could give the GC problems.
-rw-r--r--ext/raindrops/raindrops.c12
1 files 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;
 }
 
 /*