Commit Graph

41 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 1e36d7662c object.h: rename gccolor to clearer gc_color 2025-03-10 14:23:51 +09:00
Yukihiro "Matz" Matsumoto 8276143f03 object.h: remove MRB_SET_FROZEN_FLAG/MRB_UNSET_FROZEN_FLAG macros
Simple `o->frozen = 1/0` now works.
2025-01-07 13:56:30 +09:00
Yukihiro "Matz" Matsumoto c11d18e426 object.h: unify MRB_FROZEN_P() and mrb_frozen_p() 2025-01-07 11:24:58 +09:00
Yukihiro "Matz" Matsumoto 21003746df object.h: separate frozen flag to the independent bit-field
So that other flag operation do not break frozen flag.
2025-01-07 07:44:10 +09:00
Yukihiro "Matz" Matsumoto 6f8bfed18e object.h: change gccolor type to unsigned int
I was uncomfortable with the combination of an integer with a size
specification (uint32_t) and a bit field.
2025-01-06 13:56:58 +09:00
Yukihiro "Matz" Matsumoto 0e79f6b34b include/object.h: rename color to gccolor
To clarify the color is for garbage collection.
2025-01-03 19:12:40 +09:00
Yukihiro "Matz" Matsumoto f07281a026 Revert "object.h: make GC color uint8_t that fits in 3 bits"
The change made the size of mruby data types bigger on Win.
This reverts commit afcf7fc86d.
2023-06-03 16:55:58 +09:00
Yukihiro "Matz" Matsumoto afcf7fc86d object.h: make GC color uint8_t that fits in 3 bits 2023-05-31 08:27:23 +09:00
dearblue 23611332d9 Introduced mrb_static_assert_object_size()
Asserts the size of the object structure is less than or equal to 6 words.
2022-05-28 11:08:27 +09:00
Yukihiro "Matz" Matsumoto 57d7fe94a9 Add a macro mrb_frozen_p that points to MRB_FROZEN_P. 2019-09-14 23:21:44 +09:00
KOBAYASHI Shuji b2c3d88fbf Implement mrb_immediate_p macro for MRB_WORD_BOXING
The default implementation of `mrb_immediate_p` uses `mrb_type`. However,
in `MRB_WORD_BOXING`, `mrb_type` has many branches and is inefficient, so
provide an implementation that does not use `mrb_type`.
2019-08-31 16:55:57 +09:00
KOBAYASHI Shuji 8157672a29 Use RBasic padding for embedded string on 64-bit CPU
On 64-bit CPU, there is padding in `RBasic`, so reorder the fields and use
it as buffer of embedded string. This change allows 4 more bytes to be
embedded on 64-bit CPU.

However, an incompatibility will occur if `RString::as::ary` is accessed
directly because `RString` structure has changed.
2019-08-20 18:49:55 +09:00
David Siaw b5299b1c58 fix up documentation for values 2019-08-18 20:12:44 +09:00
David Siaw 2c86895468 fix up markdown display in doxygen 2019-08-18 13:59:29 +09:00
David Siaw 8d70a9b1b5 first bit of doc generation 2019-08-18 13:07:24 +09:00
dearblue 14133f4057 Fix macro arguments with paren 2018-12-18 23:05:36 +09:00
Yukihiro "Matz" Matsumoto 8558627b9b Reorganize flags values for classes; fix #3975
Renamed flag macro names as well:
`MRB_FLAG_IS_FROZEN` -> `MRB_FL_OBJ_FROZEN`
`MRB_FLAG_IS_PREPENDED` -> `MRB_FL_CLASS_IS_PREPENDED`
`MRB_FLAG_IS_ORIGIN` -> `MRB_FL_CLASS_IS_ORIGIN`
`MRB_FLAG_IS_INHERITED` -> `MRB_FL_CLASS_IS_INHERITED`
2018-07-31 16:48:50 +09:00
Yukihiro "Matz" Matsumoto 7edbe428ca Add new type of shared string: RSTR_FSHARED.
`RSTR_FSHARED` use frozen strings as shared body instead of
`struct mrb_shared_string`. This reduces allocation from
literal strings.
2017-10-01 16:24:43 +09:00
Yukihiro "Matz" Matsumoto 92c843dd07 rename prefix RBASIC_ to MRB_; ref #3340 2016-12-12 00:54:36 +09:00
Takashi Kokubun 10bb7ad693 Implement Object#freeze 2016-12-11 03:44:15 +09:00
furunkel 3ab2f9371e Clean up GC code 2015-10-19 22:29:43 +02:00
Corey Powell eb172c28d7 Applied gc patch to fix ORIGIN ICLASS method table leak
Based on the gc patch by ko1

https://github.com/ruby/ruby/commit/5922c954614e5947a548780bb3b894626affe6dd
2015-07-14 09:44:04 -05:00
cremno 17b0d658fc delete obsolete macros (mrb_basic + mrb_object)
Over a year ago is not "soon" anymore. See:
88483fad00
243669308d
2014-08-29 16:47:28 +02:00
take_cheeze fc8b48faf8 Move word boxing structs to "mruby/boxing_word.h". 2014-07-20 23:02:04 +09:00
David Turnbull 249f05e7d7 Clean up value.h and mrb_value boxing 2014-07-09 06:32:11 +09:00
Yukihiro Matz Matsumoto 3ceadfa5b2 inline include/mruby/object.h 2012-11-05 06:10:22 +09:00
Yukihiro Matz Matsumoto 3e1dd77b16 remove ROBJECT_{IVPTR,NUMIV} 2012-11-04 13:57:25 +09:00
Yukihiro Matz Matsumoto c903910c6b replace RBASIC by mrb_basic 2012-11-04 13:56:08 +09:00
Yukihiro Matsumoto 97b7eb6096 rename MRUBY_OBJECT_HEADER to MRB_OBJECT_HEADER 2012-08-18 19:05:18 +09:00
Yukihiro Matsumoto 41e7d0b475 use bit field mrb_vtype in MRUBY_OBJECT_HEADER 2012-08-18 19:02:50 +09:00
Yukihiro Matsumoto 7d02df3016 NaN boxing 2012-08-14 13:16:34 +09:00
Yukihiro Matsumoto e74600c919 move mrb_value def to mruby/value.h 2012-08-14 03:09:04 +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
Yukihiro Matsumoto 81c0e2e031 make color in OBJECT_HEADER unsigned 2012-06-02 23:43:13 +09:00
Yukihiro Matsumoto a4d3579e31 add extern "C" guards; close #126 2012-05-18 02:02:49 +09:00
Yukihiro Matsumoto b0e94d8c14 Time class available; based on code from @beoran; sorry for jumbo patch 2012-05-06 00:52:22 +09:00
Yukihiro Matsumoto c9a51c43bc use int8_t for tt 2012-05-05 07:59:15 +09:00
roco 4ec6d41f16 rm whitespace 2012-04-30 14:29:19 -07:00
mimaki 835443614d add file header 2012-04-23 11:46:16 +09:00
NAKAMURA Usaku 2161737c2d MRUBY_OBJECT_HEADER is always used with `;', but, in the definition of a struct, you cannot include any statement except declarations, even if the statement is void statement. 2012-04-20 15:35:57 +09:00
mimaki e0d6430f63 add mruby sources 2012-04-20 09:39:03 +09:00