aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-11-01 16:48:31 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-11-01 16:58:19 +0900
commit72f997edf66cb766b97feac709888c57852be084 (patch)
tree0d98781c0340a00d5fa348df6659f65898c3a50e /internal.h
parentf5e406327200672f95d61c4ca4ffc9de03e6a5a7 (diff)
downloadruby-72f997edf66cb766b97feac709888c57852be084.tar.gz
mark functions that do not return NULL as such.
Apply __attribute__((__returns_nonnull__)) when available.
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal.h b/internal.h
index c10bac5358..6c6e262f65 100644
--- a/internal.h
+++ b/internal.h
@@ -1624,8 +1624,8 @@ void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj);
#define SIZED_REALLOC_N(var,type,n,old_n) REALLOC_N(var, type, n)
#else
RUBY_SYMBOL_EXPORT_BEGIN
-void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_ALLOC_SIZE((2));
-void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_ALLOC_SIZE((2, 3));
+void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
+void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
void ruby_sized_xfree(void *x, size_t size);
RUBY_SYMBOL_EXPORT_END
#define SIZED_REALLOC_N(var,type,n,old_n) ((var)=(type*)ruby_sized_xrealloc2((void*)(var), (n), sizeof(type), (old_n)))