diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | random.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Jan 7 21:12:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp> + + * random.c (rand_init): use ALLOC_N instead of ALLOCA_N + [ruby-dev:25426] + Fri Jan 7 18:03:35 2005 Tanaka Akira <akr@m17n.org> * gc.c (mark_locations_array): avoid core dump with -O3. @@ -216,7 +216,7 @@ rand_init(vseed) rb_obj_classname(vseed)); } len = (len + 3) / 4; /* number of 32bit words */ - buf = ALLOCA_N(long, len); /* allocate longs for init_by_array */ + buf = ALLOC_N(long, len); /* allocate longs for init_by_array */ memset(buf, 0, len * sizeof(long)); if (FIXNUM_P(seed)) { buf[0] = FIX2ULONG(seed) & 0xffffffff; @@ -248,7 +248,7 @@ rand_init(vseed) first = 0; old = saved_seed; saved_seed = seed; - + free(buf); return old; } |