evanphx / rubinius

Rubinius, the Ruby VM

rubinius / vm / builtin_memorypointer.hpp
100644 25 lines (18 sloc) 0.547 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef RBX_BUILTIN_MEMORYPOINTER_HPP
#define RBX_BUILTIN_MEMORYPOINTER_HPP
 
namespace rubinius {
  class MemoryPointer : public BuiltinType {
    public:
    const static size_t fields = 0;
    const static object_type type = MemPtrType;
 
    void* pointer;
 
    static MemoryPointer* create(STATE, void* ptr);
 
    OBJECT get_field(STATE, int offset, int type);
    void set_field(STATE, int offset, int type, OBJECT val);
 
    class Info : public TypeInfo {
    public:
      Info(object_type type) : TypeInfo(type) { }
    };
  };
}
 
#endif