00001 #ifndef Exc_Ruby__use_ruby_allocator__hpp_
00002 #define Exc_Ruby__use_ruby_allocator__hpp_
00003
00004
00005
00006
00007 #define USE_RUBY_ALLOCATOR \
00008 static void* operator new(size_t s) \
00009 { \
00010 return ruby_xmalloc(s); \
00011 } \
00012 \
00013 static void operator delete(void* p) \
00014 { \
00015 ruby_xfree(p); \
00016 }
00017
00018
00019 namespace Exc_Ruby
00020 {
00021
00022 class Use_Ruby_Allocator
00023 {
00024 protected:
00025 ~Use_Ruby_Allocator() { }
00026
00027 USE_RUBY_ALLOCATOR
00028 };
00029
00030 }
00031
00032 #endif // Exc_Ruby__use_ruby_allocator__hpp_
00033