summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-os-memsize
AgeCommit message (Collapse)Author
2021-09-30value.h: introduce `MRB_TT_STRUCT` for `mruby-struct`.Yukihiro "Matz" Matsumoto
2021-03-21memsize.c: handle `MRB_TT_RATIONAL` and `MRB_TT_COMPLEX`.Yukihiro "Matz" Matsumoto
2021-01-16Fix NULL pointer dereference with mruby-os-memsize and mruby-methoddearblue
If it gets an insubstantial method object with `obj.method`, it will raise a `SIGSEGV` with `ObjectSpace.memsize_of(method)`.
2020-11-13Rename `mrb_os_memsize_of_hash_table` to `mrb_hash_memsize`KOBAYASHI Shuji
* The term `hash_table` can be misleading because the return value of this function includes memory usage of entire `Hash` object, including not only hash table part but also entry list part, etc. * This function takes a `Hash` object as a receiver and is defined in `src/hash.c`, so it is natural to have a `mrb_hash_` prefix.
2020-11-12Remove unused argument of `mrb_obj_iv_tbl_memsize`KOBAYASHI Shuji
2020-10-12Fixed wrong size calculation for `memsize_of()`.Yukihiro "Matz" Matsumoto
2020-10-12Rename `MRB_TT_FIXNUM` to `MRB_TT_INTEGER`.Yukihiro "Matz" Matsumoto
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
2020-10-12Replace global jump with catch handler implementationdearblue
When a global jump occurs, look at the catch handler table to determine where to jump. In that case, `pc` already shows the following instruction, but since the table shows `begin_offset ... end_offset`, the comparison is done with `begin_offset < pc && pc <= end_offset`. If there is a corresponding handler, move `pc` to `handler.target_offset` and continue running the VM. When a global jump across `ensure` is made by `return`, `break`, `next`, `redo` and `retry`, the extended `RBreak` object saves and restores the C-level execution position. This extended `RBreak` can have tag information, which makes it a pseudo coroutine (the "tag" mimics CRuby). The implementation of pseudo coroutines by `RBreak` is summarized by `CHECKPOINT_RESTORE ... CHECKPOINT_MAIN ... CHECKPOINT_END` and `throw_tagged_break` / `unwind_ensure` macros. The restart of processing is branched by `RBREAK_TAG_FOREACH(DISPATCH_CHECKPOINTS)`. - Not only `rescue` blocks but also `ensure` blocks are now sandwiched between `OP_EXCEPT` and `OP_RAISEIF`. - Remove the function `ecall()`. It is no longer necessary to re-enter the VM to perform an "ensure block". This will resolves #1888. - Added instruction `OP_JUW` (Jump while UnWind). It jumps unconditionally like `OP_JMP`, but searches the catch handler table and executes the ensure block. Since it searches the catch handler table, it is much heavier than `OP_JMP`.
2020-08-11Fix `mrb_int` and `size_t` combination warnings.Yukihiro "Matz" Matsumoto
2020-07-26Update document for `ObjectSpace.memsize_of` [ci skip]dearblue
The `recurse` keyword is removed by f00657ead7c3e5f6f9a346d7797a280b5c9f02fa.
2020-07-24Avoid using FPU with `mruby-os-memsize`; ref #5032dearblue
And, in the calculation of the instance variable size, the fraction was always rounded down because of division of integers, so fix it. At the same time, test items that are no longer passed due to this change are deleted.
2020-07-24Support without `mruby-method` for `mruby-os-memsize`; ref #5032dearblue
2020-07-24Add NUL terminator to string object size calculation; ref #5032dearblue
2020-07-22Fixed garbled characters; ref #5041dearblue
2020-07-19Separate `memsize_of` and `memsize_of_all` to a separate gem; #5040Rory OConnell
Those methods are originally CRuby specific. Co-authored-by: Yukihiro "Matz" Matsumoto <[email protected]>