diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-14 16:13:41 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-14 16:13:41 +0000 |
commit | 434c9e7b9f4a97240f69ab0d8cc46cf726f96d52 (patch) | |
tree | 1f4289f9ba87d6a049b727463c92691c9defe363 | |
parent | 89e1e190835430068472d12450b538ad351871b9 (diff) | |
download | ruby-434c9e7b9f4a97240f69ab0d8cc46cf726f96d52.tar.gz |
* st.c (malloc): use xmalloc/xcalloc instead of plain
malloc/calloc, to detect memory allocation failure. see
<http://www.nongnu.org/failmalloc/>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | st.c | 7 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Sat Jul 15 01:09:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * st.c (malloc): use xmalloc/xcalloc instead of plain + malloc/calloc, to detect memory allocation failure. see + <http://www.nongnu.org/failmalloc/>. + Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5. @@ -2,12 +2,12 @@ /* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */ -#include "config.h" #include <stdio.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif #include <string.h> +#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)) |