summaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-06 07:52:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-06 07:52:18 +0000
commitd71587b664e527fa13e72f0ec88f08adac75d03e (patch)
tree85defa29ffcd96708764da38bc210603e89aa5e8 /st.c
parent4286de264af575dc719e5cdc6421c3bd4e7e7899 (diff)
downloadruby-d71587b664e527fa13e72f0ec88f08adac75d03e.tar.gz
ruby-d71587b664e527fa13e72f0ec88f08adac75d03e.tar.xz
ruby-d71587b664e527fa13e72f0ec88f08adac75d03e.zip
* gc.c (ruby_xmalloc2): change check for integer overflow.
[ruby-dev:27399] * gc.c (ruby_xrealloc2): ditto. * eval.c (exec_under): avoid accessing ruby_frame->prev. [ruby-dev:27948] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'st.c')
-rw-r--r--st.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/st.c b/st.c
index 5aa202fe7..220610094 100644
--- a/st.c
+++ b/st.c
@@ -18,9 +18,9 @@
#define xrealloc ruby_xrealloc
#define xfree ruby_xfree
-void *xmalloc(long);
-void *xcalloc(long, long);
-void *xrealloc(void *, long);
+void *xmalloc(size_t);
+void *xcalloc(size_t, size_t);
+void *xrealloc(void *, size_t);
void xfree(void *);
#endif
#endif
@@ -65,7 +65,7 @@ static struct st_hash_type type_strhash = {
static void rehash(st_table *);
-#define alloc(type) (type*)xmalloc((unsigned)sizeof(type))
+#define alloc(type) (type*)xmalloc((size_t)sizeof(type))
#define Calloc(n,s) (char*)xcalloc((n),(s))
#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)