Commit Graph

51 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 670b54f859 variable.h: add prefetch to bsearch_idx
This commit introduces memory prefetching to the `bsearch_idx` functions
in `src/class.c` and `src/variable.c` to improve performance.

A new macro `MRB_MEM_PREFETCH` is defined in `include/mruby/variable.h`
which uses `__builtin_prefetch` if available.

Co-authored-by: Gemini <gemini@google.com>
2025-07-11 10:09:35 +09:00
Yukihiro "Matz" Matsumoto b99c389ec3 internal.h: aggregate internal functions.
Internal functions can only be called from within the library.
Functions listed in `mruby/internal.h` can be called from:

* core (src/*.c)
* gems (mrbgems/**/*.c)

But not from the application linked with `libmruby`.
2022-04-02 18:25:13 +09:00
KOBAYASHI Shuji 903fbd767a Remove unused struct in include/mruby/variable.h 2021-04-20 16:53:11 +09:00
KOBAYASHI Shuji ff2ef44c0e Remove unused argument of mrb_obj_iv_tbl_memsize 2020-11-12 20:19:41 +09:00
Yukihiro "Matz" Matsumoto 5e55b61c44 Fix mrb_int and size_t combination warnings. 2020-08-11 15:06:51 +09:00
Rory OConnell 6f945a09b4 Use object iv table size in calculation 2020-07-13 15:59:24 -07:00
David Siaw 6375639917 fix lots of warnings and make logo not so big 2019-08-26 02:08:33 +09:00
David Siaw b5299b1c58 fix up documentation for values 2019-08-18 20:12:44 +09:00
KOBAYASHI Shuji cc7f9190ba Fix name assignment to frozen anonymous class/module
Fix the following issues:

  A = Class.new.freeze              #=> FrozenError
  Module.new::B = Class.new.freeze  #=> FrozenError
  String::B = Module.new.freeze     #=> FrozenError
2019-04-23 20:45:38 +09:00
KOBAYASHI Shuji 16b1b2978e Fix constant name validation
`X!` etc are invalid constant name.
2019-03-14 23:09:05 +09:00
Yukihiro "Matz" Matsumoto e935d20ab5 Add mrb_ prefix to iv_foreach_func. 2018-12-11 10:39:53 +09:00
Yukihiro "Matz" Matsumoto a0df27d8e0 Add new API mrb_iv_foreach() to iterate over instance variables. 2018-12-11 09:48:15 +09:00
Yukihiro "Matz" Matsumoto 0dca6206c1 Rename ambiguous function names.
`mrb_iv_p` -> `mrb_iv_name_sym_p`
`mrb_iv_check` -> `mrb_iv_name_sym_check`
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto 8f386f7663 Remove utility functions: mrb_vm_iv_{get,set}. 2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto 43ec918be1 Remove unused mrb_obj_iv_ifnone() from API. 2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto da24af34b9 Better class name management.
The change removes several internal instance variables used by
class name management. The variables `__classid__` and `__classpath__`
are no longer available. `__outer__` is used only for unnamed outer
classes/modules (and will be removed after they are named).

[Important note]
Along with this change we removed several public functions.

 - mrb_class_outer_module()
 - mrb_class_sym()

We believe no one have used those functions, but if you do, please
ask us for the workaround.
2017-08-01 22:25:49 +09:00
Yukihiro "Matz" Matsumoto f9f19f34dd replace _cstr by _lit for litral C strings; ref #3300 2016-11-27 20:53:25 +09:00
Herwin Weststrate afee618c1b Added documentation on function for globals 2016-11-27 09:50:30 +01:00
Yukihiro "Matz" Matsumoto 065966dae4 common.h are supposed to be included from other header, so call it with quotes; ref #3032 2015-11-28 00:10:38 +09:00
Yukihiro "Matz" Matsumoto 5c405dea3d include changed from by quotes ("") to by brackets (<>); close #3032 2015-11-27 17:48:23 +09:00
Seba Gamboa a0fe0c40b1 Remove old doxygen tags 2015-10-08 12:29:10 -03:00
Seba Gamboa 40bf7bde78 Sorting documentation grouping 2015-09-21 01:48:42 -03:00
Seba Gamboa c127614638 Setting up doxygen groups 2015-09-20 21:14:07 -03:00
Xuejie "Rafael" Xiao 164cb87c5b Fix mrb_iv_check function decleration 2014-11-10 10:12:40 +08:00
Yukihiro "Matz" Matsumoto 95c7f570e1 change class argument of mrb_const_defined_at from struct RClass* to mrb_value to make it consistent with mrb_const_defined; ref #2593 2014-09-19 02:51:52 +09:00
Yukihiro "Matz" Matsumoto 6c7b0d88e8 refactor valid instance variable name check 2014-09-02 16:37:40 +09:00
Tatsuhiko Kubo 5fa30aeaea Fix mismatches for MRB_API declarations. 2014-08-29 01:06:22 +09:00
Yukihiro "Matz" Matsumoto 206f89e209 add MRB_API modifiers to mruby API functions 2014-08-04 00:47:08 +09:00
take_cheeze dbece716ea Use mrb_bool as return type of mrb_const_defined_at. 2014-07-14 21:04:22 +09:00
cubicdaiya cee152670a unify indent style 2014-03-16 07:44:44 +09:00
cubicdaiya 67de10bfcb use C style comments instead of C++ style comments
According to CONTRIBUTING.md,

Don't use C++ style comments

 /* This is the prefered comment style */

Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-03-01 03:31:45 +09:00
Yukihiro "Matz" Matsumoto 400ccecf0a add mrb_gv_remove(); untested 2013-10-10 12:12:29 +09:00
Yukihiro "Matz" Matsumoto 013be527e6 add Module#constants (15.2.2.4.24) 2013-04-02 01:23:41 +09:00
Yukihiro Matz Matsumoto 0425db66b6 Use mrb_bool instead of int. This is for portability; based on e767ebf but iv_foreach_func must return int 2013-03-24 00:07:13 +09:00
Yukihiro Matz Matsumoto 37fe3d666f add Module#remove_const 2013-02-15 10:20:55 +09:00
skandhas 9599381ae3 add mrb_mod_cv_defined and mrb_cv_defined 2012-12-23 15:25:24 +08:00
skandhas 824bacbee4 add mrb_mod_cv_set, mrb_cv_set 2012-12-21 14:22:35 +08:00
skandhas a9f1c4593c add mrb_cv_get 2012-12-20 21:33:30 +08:00
skandhas 5a65a7258f add mrb_mod_cv_get 2012-12-20 21:29:35 +08:00
Yukihiro Matz Matsumoto f63d5c2905 new function mrb_obj_iv_ifnone() 2012-12-12 18:22:23 +09:00
skandhas 1cc44cfd78 add Module#class_variables 2012-11-09 23:00:24 +08:00
Yukihiro Matsumoto 7d02df3016 NaN boxing 2012-08-14 13:16:34 +09:00
Yukihiro Matsumoto c9fe903fe1 now segmented list can be used as instance variable tables by -DMRB_USE_IV_SEGLIST; we still need to measure the performance and memory consumption 2012-08-12 01:59:18 +09:00
Masaki Muranaka 7ac4b56141 Remove unimplemented declarations. 2012-07-29 20:35:23 +09:00
Yukihiro Matsumoto 1fa63930fd check object type before retrieving instance variabls; close #311 2012-06-23 10:40:17 +09:00
Yukihiro Matsumoto 396397bce1 move KHASH_DECLARE to header files 2012-06-21 11:04:36 +09:00
Yukihiro Matsumoto 1a369de489 remove src/gc.h 2012-06-07 01:18:17 +09:00
Frank Celler aeffe3f712 fixed prototype: g++ will complain about definition not being a prototype, should work with GCC and VC as well 2012-06-02 11:54:14 +02:00
Yukihiro Matsumoto a4d3579e31 add extern "C" guards; close #126 2012-05-18 02:02:49 +09:00
roco 4ec6d41f16 rm whitespace 2012-04-30 14:29:19 -07:00