summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-06-25 15:38:28 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-06-25 15:38:28 +0900
commit3ceeb0be95874fe867f25004618c31ca8e23ecf4 (patch)
tree87bb0c119ce43a09603b1a159da2fa1605106534 /include/mruby.h
parentd90c5c8e848dbcff500e04eca7c8601409aad0ef (diff)
downloadmruby-3ceeb0be95874fe867f25004618c31ca8e23ecf4.tar.gz
mruby-3ceeb0be95874fe867f25004618c31ca8e23ecf4.zip
add mrb_malloc_simple() that returns NULL on error
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 33a15de0e..29d13c553 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -239,9 +239,10 @@ mrb_sym mrb_intern(mrb_state *mrb,const char *cstr)
return mrb_intern_cstr(mrb, cstr);
}
-void *mrb_malloc(mrb_state*, size_t);
-void *mrb_calloc(mrb_state*, size_t, size_t);
-void *mrb_realloc(mrb_state*, void*, size_t);
+void *mrb_malloc(mrb_state*, size_t); /* raise RuntimeError if no mem */
+void *mrb_calloc(mrb_state*, size_t, size_t); /* ditto */
+void *mrb_realloc(mrb_state*, void*, size_t); /* ditto */
+void *mrb_malloc_simple(mrb_state*, size_t); /* return NULL if no memory available */
struct RBasic *mrb_obj_alloc(mrb_state*, enum mrb_vtype, struct RClass*);
void mrb_free(mrb_state*, void*);