From 434c9e7b9f4a97240f69ab0d8cc46cf726f96d52 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 14 Jul 2006 16:13:41 +0000 Subject: * st.c (malloc): use xmalloc/xcalloc instead of plain malloc/calloc, to detect memory allocation failure. see . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- st.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'st.c') diff --git a/st.c b/st.c index 2e23050867..24fde6eb27 100644 --- a/st.c +++ b/st.c @@ -2,12 +2,12 @@ /* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */ -#include "config.h" #include #ifdef HAVE_STDLIB_H #include #endif #include +#include "defines.h" #ifdef NOT_RUBY #include "regint.h" @@ -53,6 +53,11 @@ static struct st_hash_type type_strhash = { static void rehash(st_table *); +#ifdef RUBY +#define malloc xmalloc +#define calloc xcalloc +#endif + #define alloc(type) (type*)malloc((size_t)sizeof(type)) #define Calloc(n,s) (char*)calloc((n),(s)) -- cgit v1.2.3