KOBAYASHI Shuji
c0fb675526
Reorganize types for ObjectSpace.count_objects
...
#### Addition
- T_COMPLEX
- T_RATIONAL
#### Deletion
- T_FALSE
- T_FREE
- T_TRUE
- T_SYMBOL
- T_UNDEF
2021-03-22 12:24:42 +09:00
Yukihiro "Matz" Matsumoto
17ecf14511
Revert "Minimize the changes in #5277 "
...
This reverts commit dc51d89ac2 .
2021-01-26 10:57:07 +09:00
Yukihiro "Matz" Matsumoto
dc51d89ac2
Minimize the changes in #5277
...
Instead of including `mruby/presym.h` everywhere, we provided the
fallback `mruby/presym.inc` under `include/mruby` directory, and specify
`-I<build-dir>/include` before `-I<top-dir>/include` in `presym.rake`.
So even when someone drops `-I<build-dir>/include` in compiler options,
it just compiles without failure.
2021-01-22 18:38:53 +09:00
KOBAYASHI Shuji
90b53f4c29
Avoid including presym.inc in existing header files
...
Addressed an issue where existing programs linking `libmruby.a` could only
be built by adding `<build-dir>/include` to compiler's include path.
2021-01-11 09:21:07 +09:00
Yukihiro "Matz" Matsumoto
55163a8a0a
Rename MRB_TT_FIXNUM to MRB_TT_INTEGER.
...
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
2020-10-12 16:21:47 +09:00
Yukihiro "Matz" Matsumoto
eddd324979
Add MRB_SYM() for inline symbols.
2020-10-12 16:20:41 +09:00
Yukihiro "Matz" Matsumoto
c69ca2c7f8
Merge pull request #5045 from dearblue/memsize_of
...
Improve `mruby-os-memsize`
2020-07-24 12:02:05 +09:00
Yukihiro "Matz" Matsumoto
b4f4f5968b
ObjectSpace.count_objects to support MRB_TT_ISTRUCT; #5046
2020-07-23 07:10:35 +09:00
dearblue
639703cf01
Remove unnecessory methods in mruby-objectspace; ref #5041
...
The `ObjectSpace#memsize_of` and `ObjectSpace#memsize_of_all` in `mruby-objectspace` ware
migrated to `mruby-os-memsize` mrbgem.
2020-07-21 23:32:30 +09:00
Rory OConnell
5f4a27217e
Separate memsize_of and memsize_of_all to a separate gem; #5040
...
Those methods are originally CRuby specific.
Co-authored-by: Yukihiro "Matz" Matsumoto <matz@ruby.or.jp >
2020-07-19 15:36:08 -07:00
Yukihiro "Matz" Matsumoto
c9ea39843b
Remove some tests from mruby-objectspace gem; #5040
...
Those tests succeeds only on some configuration.
2020-07-20 06:05:06 +09:00
Yukihiro "Matz" Matsumoto
a6f31ad6ce
Avoid accessing obj.tt of mrb_value; #5040
...
The old code compiles only on `MRB_NO_BOXING`.
2020-07-20 06:05:06 +09:00
Yukihiro "Matz" Matsumoto
07b75d927e
Replace 0 by MRB_EACH_OBJ_OK; #5040
2020-07-20 06:04:54 +09:00
Yukihiro "Matz" Matsumoto
71254be076
Skip MRB_TT_FREE and MRB_TT_BREAK in each_object.
2020-07-19 13:11:53 +09:00
Yukihiro "Matz" Matsumoto
1d2c5c12d3
Reorder members of struct os_each_object_data to stop warnings.
...
`mrb_value` may or may not be struct according to configuration.
2020-07-19 13:10:08 +09:00
Yukihiro "Matz" Matsumoto
00337543a5
Should have updated the arg spec for memsize_of&memsize_of_all; #5040
2020-07-19 09:11:16 +09:00
Yukihiro "Matz" Matsumoto
f76defd310
Use c specifier for mrb_get_args.
2020-07-19 07:47:07 +09:00
Yukihiro "Matz" Matsumoto
5b2763821e
Fix memsize_of_all to count all objects if no argument given; #5040
2020-07-19 07:42:35 +09:00
Yukihiro "Matz" Matsumoto
6d073f8d99
Fix memsize_of_all to count memory of subclass instances; #5040
...
`ObjectSpace.memsize_of_all` takes a class and count memory size of all
instances of the class and its subclasses (if any).
2020-07-19 06:57:34 +09:00
Rory O'Connell
ffe8bf6323
Avoid singleton classes with mrb_class_real
2020-07-18 13:55:45 -07:00
Rory OConnell
a79d1ba9ff
Adding memsize_of_all doc
2020-07-17 20:21:23 -07:00
Rory OConnell
fe1ec9afdd
Add ObjectSpace.memsize_of_all
2020-07-17 20:09:44 -07:00
Yukihiro "Matz" Matsumoto
e41f1f5139
Fix indent of compiler conditions; #5032
2020-07-17 12:32:54 +09:00
Yukihiro "Matz" Matsumoto
495c1a377a
Fix memsize_of to count method table size; #5032
...
Also avoid `mrb_funcall` to minimize VM recursion.
2020-07-17 12:31:00 +09:00
Yukihiro "Matz" Matsumoto
9f52bcfca9
Fix memsize_of Fibers; #5032
...
Memory size of a Fiber is calculated by stack size only in CRuby.
2020-07-17 11:50:12 +09:00
Yukihiro "Matz" Matsumoto
a2b8c08a52
Add const to irep pointer in os_memsize_of_irep; #5032
2020-07-17 11:43:55 +09:00
Yukihiro "Matz" Matsumoto
f00657ead7
Remove recursive memsize_of; #5032
...
This is enhancement from CRuby's `memsize_of`. We need to change the
CRuby first for the enhancement.
2020-07-17 11:15:07 +09:00
Yukihiro "Matz" Matsumoto
2e56da5a78
Remove MRB_TT_DATA calculation of memsize_of; #5032
2020-07-17 10:59:43 +09:00
Yukihiro "Matz" Matsumoto
60279b2a8e
Use mrb_test instead of mrb_obj_eq; #5032
2020-07-17 10:53:24 +09:00
Yukihiro "Matz" Matsumoto
c6b8b58e0e
Fix memsize_of for fiber objects; #5032
2020-07-17 10:53:04 +09:00
Yukihiro "Matz" Matsumoto
7f66cf7d66
Fix memsize_of for string objects; #5032
2020-07-17 10:52:59 +09:00
Rory O'Connell
f74d370c15
mrb_ prefix convention
2020-07-15 19:57:22 -07:00
Rory O'Connell
38b0759108
Clarify memsize_of documentation
2020-07-14 23:43:10 -07:00
Rory O'Connell
4d32c671a7
Finishing out memsize_of recursion
2020-07-14 23:30:35 -07:00
Rory OConnell
0e5394638b
Validate ensure stack presense before calculating
2020-07-13 17:05:03 -07:00
Rory OConnell
ad44021591
C89 compiler mode fixes
2020-07-13 16:43:59 -07:00
Rory OConnell
5759256ff8
Update tests for new calculations
2020-07-13 16:00:49 -07:00
Rory OConnell
5184263bdc
Calculating sizes of VM components for a Fiber
2020-07-13 16:00:14 -07:00
Rory OConnell
6f945a09b4
Use object iv table size in calculation
2020-07-13 15:59:24 -07:00
Rory OConnell
e7bd7d0eaf
Use size of hash's table in calculation
2020-07-13 15:58:50 -07:00
Rory OConnell
41e3220539
All values use page slot size in calculation
2020-07-13 15:56:27 -07:00
Rory OConnell
37d6628688
fix case scopes and variable names
2020-07-10 00:57:45 -07:00
Rory OConnell
338c8538c9
Initial ObjectSpace.memsize_of implementation
2020-07-09 18:52:31 -07:00
Yukihiro "Matz" Matsumoto
f93dffb5ee
Remove unused MRB_TT_FILE.
2020-06-15 07:47:22 +09:00
dearblue
099a4f3969
Entrust "no block given" error to mrb_get_args()
...
Some error messages will be changed.
2019-09-16 20:29:58 +09:00
KOBAYASHI Shuji
92f00d3e58
Fix missing assertions in mruby-objectspace test
2019-06-02 19:15:20 +09:00
Yukihiro "Matz" Matsumoto
cca19532c5
Remove Kernel#class_defined? which is not available in CRuby; #3829
2019-01-03 11:34:35 +09:00
Yukihiro "Matz" Matsumoto
8c9e712784
Keyword argument implemented.
2018-07-30 22:58:01 +09:00
Yukihiro "Matz" Matsumoto
6a9efd6849
Invoke mrb_full_gc() before ObjectSpace.count_objects.
2017-11-19 12:19:46 +09:00
Yukihiro "Matz" Matsumoto
62dae09bf6
Allow mrb_objspace_each_objects() to break iteration; ref #3359
2017-04-20 15:44:56 +09:00