aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-10-07 13:16:42 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-10-09 12:12:28 +0900
commita220410be70264a0e4089c4d63a9c22dd688ca7c (patch)
tree71bcf4612a1afe003c38cec3e9f4a9eb460fcf1b /internal.h
parent2f3b4029da1b64ffb989916a8b74e17c366e45b0 (diff)
downloadruby-a220410be70264a0e4089c4d63a9c22dd688ca7c.tar.gz
annotate malloc-ish functions
Make them gcc friendly. Note that realloc canot be __malloc__ attributed, according to the GCC manual.
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal.h b/internal.h
index 6956427a78..3f57523bd3 100644
--- a/internal.h
+++ b/internal.h
@@ -1639,7 +1639,12 @@ RUBY_SYMBOL_EXPORT_END
rb_wb_unprotected_newobj_of(klass, flags))
#define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags)
-void *rb_aligned_malloc(size_t, size_t);
+#ifdef __has_attribute
+#if __has_attribute(alloc_align)
+__attribute__((__alloc_align__(1)))
+#endif
+#endif
+void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_ALLOC_SIZE((2));
void rb_aligned_free(void *);
/* hash.c */