Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f1a3952

Browse files
committedAug 29, 2015
Added missing vm/alloc.hpp to git.
1 parent 3d7d1b7 commit f1a3952

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 

‎vm/alloc.hpp

+23
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)
Please sign in to comment.