We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d7d1b7 commit f1a3952Copy full SHA for f1a3952
vm/alloc.hpp
@@ -0,0 +1,23 @@
1
+#ifndef RBX_ALLOC_HPP
2
+#define RBX_ALLOC_HPP
3
+
4
+#include <stddef.h>
5
6
+namespace rubinius {
7
+#define FREE(obj) free(obj)
8
+#define ALLOC_N(type, size) ((type*)calloc((size), sizeof(type)))
9
+#define ALLOC(t) (t*)XMALLOC(sizeof(t))
10
+#define REALLOC_N(v,t,n) (v)=(t*)realloc((void*)(v), sizeof(t)*n)
11
12
+#define ALLOCA_N(type, size) ((type*)alloca(sizeof(type) * (size)))
13
+#define ALLOCA(type) ((type*)alloca(sizeof(type)))
14
+};
15
16
+extern "C" {
17
+ void* XMALLOC(size_t bytes);
18
+ void XFREE(void* ptr);
19
+ void* XREALLOC(void* ptr, size_t bytes);
20
+ void* XCALLOC(size_t items, size_t bytes);
21
+}
22
23
+#endif
0 commit comments