summaryrefslogtreecommitdiff
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
commit088fb2a36ecc4e264e5952bf8157ee30c935fd0a (patch)
tree85defa29ffcd96708764da38bc210603e89aa5e8 /st.c
parent445d6076d8f44e31bb04e45d9337c0ecfb763729 (diff)
* 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: svn+ssh://ci.ruby-lang.org/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 5aa202fe7d..2206100942 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)