mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* random.c (rand_init): use ALLOC_N instead of ALLOCA_N
by TAMURA Takashi. [ruby-dev:25426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ddecb0423e
commit
0ff8d6346e
2 changed files with 7 additions and 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.
|
||||
|
|
4
random.c
4
random.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue