diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-07 08:39:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-07 08:39:39 +0000 |
commit | eb807d42eca121df22f72b95465bba52a4e7fefa (patch) | |
tree | 35b722bc6c94d3b9c5f8f80d41e889c591a80450 /ext/bigdecimal | |
parent | c414d861c109ff546e2bc8c7264859907d6e0f76 (diff) | |
download | ruby-eb807d42eca121df22f72b95465bba52a4e7fefa.tar.gz |
* gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables. based on a patch from funny-falcon at
https://gist.github.com/856296, but honors safe level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 83d090280d..53fb678d12 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2237,11 +2237,11 @@ static int gnAlloc=0; /* Memory allocation counter */ VP_EXPORT void * VpMemAlloc(size_t mb) { - void *p = xmalloc(mb); - if (!p) { - VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1); + void *p = xmalloc((unsigned int)mb); + if(!p) { + VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1); } - memset(p, 0, mb); + memset(p,0,mb); #ifdef BIGDECIMAL_DEBUG gnAlloc++; /* Count allocation call */ #endif /* BIGDECIMAL_DEBUG */ |