Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 48 lines (36 sloc) 1.186 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#ifndef RBX_PRELUDE_HPP
#define RBX_PRELUDE_HPP

/**
* @file prelude.hpp
*
* Notably here, Symbols, Fixnums and true/false/nil are actually
* stored directly in the pointer value (and distinguished by the
* tag, see oop.hpp) but provided we do not attempt to dereference
* it, we can ALSO define a class and treat the pointer values as
* if they were real pointers to real objects of that class where
* typing is concerned. In the "instance methods", the this pointer
* is still the correct pointer value and can thus be used for the
* calculations needed.
*
* @see oop.hpp
*/

#include <stdint.h>

#include "util/optimize.hpp"

namespace rubinius {

  class State;
  class VM;

  /** Platform-dependent integer type large enough for pointers too. */
  typedef intptr_t native_int;
  typedef uintptr_t native_uint;

  typedef native_int hashval;


#define STATE rubinius::State* state
#define THREAD rubinius::ManagedThread* state
#define G(whatever) state->globals().whatever.get()
#define GO(whatever) state->globals().whatever

}

#if __GNUC__ >= 4
#define WARN_UNUSED __attribute__ ((warn_unused_result))
#else
#define WARN_UNUSED
#endif

#endif
Something went wrong with that request. Please try again.