diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-20 06:21:22 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-20 18:33:41 +0900 |
| commit | 8f2c62407c0659d84126545e19505a851059e750 (patch) | |
| tree | 7a073d389fc2f5fc7c14f86ffa96d0145bff9f82 /include/mrbconf.h | |
| parent | 6c06e77446f3cca4a92b3df8d0a5fe568c5fdc65 (diff) | |
| download | mruby-8f2c62407c0659d84126545e19505a851059e750.tar.gz mruby-8f2c62407c0659d84126545e19505a851059e750.zip | |
Add `MRB_METHOD_TABLE_INLINE` option.
Now the method tables (in classes/modules and caches) keeps C function
pointers without wrapping in `struct RProc` objects. For the sake of
portability, `mrb_method_t` is represented by the struct and union, but
if the most significant bit of the pointer is not used by the platform,
`mrb_method_t` should be packed in `uintptr_t` to reduce memory usage.
`MRB_METHOD_TABLE_INLINE` is turned on by default for linux.
Diffstat (limited to 'include/mrbconf.h')
| -rw-r--r-- | include/mrbconf.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h index c4f6f38cd..96ab6b77f 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -36,6 +36,13 @@ /* size of the method cache (need to be the power of 2) */ //#define MRB_METHOD_CACHE_SIZE (1<<7) +/* add -DMRB_METHOD_TABLE_INLINE unless platform uses MSB of pointers */ +//#define MRB_METHOD_TABLE_INLINE +/* turn MRB_METHOD_TABLE_INLINE on for linux by default */ +#if !defined(MRB_METHOD_TABLE_INLINE) && defined(__linux__) +# define MRB_METHOD_TABLE_INLINE +#endif + /* add -DMRB_INT16 to use 16bit integer for mrb_int; conflict with MRB_INT64 */ //#define MRB_INT16 |
