summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2019-04-01Avoid keeping pointers from `mrb_sym2name_len()`; fix #4342Yukihiro "Matz" Matsumoto
The addresses for packed inline symbols reference `mrb->symbuf` that could be overridden by the later call of `mrb_sym2name_len`. Since file names in call stack information are kept as symbols, keeping the address in the C structures could cause problems like #4342. This changes small incompatible changes in function prototypes: * `mrb_parser_get_filename`: return value changed to `mrb_sym`. * `mrb_debug_get_filename`: add `mrb_state*` as a first argument. * `mrb_debug_get_line`: ditto. I believe above functions are almost internal, and no third-party mrbgem use them.
2019-03-28Use `mrb_sym2str` in implementation of `Symbol#to_s`KOBAYASHI Shuji
2019-03-28Fixed mistakes in 92dce05Yukihiro "Matz" Matsumoto
* rename `sym2name` to `sym2name_len`. * `MRB_API` -> `static`
2019-03-27Merge pull request #4344 from shuujii/remove-unused-variable-in-each_backtraceYukihiro "Matz" Matsumoto
Remove unused variable in `each_backtrace()`
2019-03-27Remove unused variable in `each_backtrace()`KOBAYASHI Shuji
2019-03-27Fix another bug related to #4342Yukihiro "Matz" Matsumoto
For short symbols with alpha numeric characters, `mrb_sym2name_len()` returns the same buffer `mrb->symbuf`. Some occasion, we forget the fact that the second call could overwrite the result of first call of the function. We have prepared the static function `sym2name()` which specifies the buffer region for inline packed symbols and use the function in `mrb_sym_to_s`.
2019-03-27Avoid using 'mrb_str_new_static` if a symbol is packed; fix #4342Yukihiro "Matz" Matsumoto
2019-03-26Fix missing `MRB_API` prefix for functions below; clse #4267Yukihiro "Matz" Matsumoto
Functions to add prototypes to headers: * mrb_ary_splice() * mrb_notimplement() * mrb_vformat() * mrb_cstr_to_dbl() * mrb_cstr_to_inum() Functions to be made `static` (`MRB_API` was not needed): * mrb_mod_module_function() * mrb_obj_hash() * mrb_str_len_to_inum() Functions to remove `MRB_API` from definitions (referenced from within `libmruby`): * mrb_mod_cv_defined() * mrb_mod_cv_get() * mrb_f_send()
2019-03-25Use uppercase version of `ctype` macros e.g. `ISSPACE`; fix #4338Yukihiro "Matz" Matsumoto
2019-03-25Remove implementation of `Symbol#===`KOBAYASHI Shuji
For reducing program size.
2019-03-25Need to check length before packing a symbol; fix #4340Yukihiro "Matz" Matsumoto
2019-03-24Fix arguments spec in `src/proc.c`KOBAYASHI Shuji
2019-03-21Fix `Float#eql?`KOBAYASHI Shuji
2019-03-17Fix class/instance variable name validationKOBAYASHI Shuji
- `@@?` etc are invalid class variable name. - `@1` etc are invalid instance variable name.
2019-03-15Merge pull request #4328 from shuujii/fix-constant-name-validationYukihiro "Matz" Matsumoto
Fix constant name validation
2019-03-15Use `fmt_fp()` for portable float representation.Yukihiro "Matz" Matsumoto
2019-03-14Fix constant name validationKOBAYASHI Shuji
`X!` etc are invalid constant name.
2019-03-11Reduce `String` creation in `check_(cv|const)_name_sym`KOBAYASHI Shuji
2019-03-03Extract similar code fragment to method in `src/class.c`KOBAYASHI Shuji
2019-03-02Do not apply `mrb_ptr()` to immediate objects; fix #4307Yukihiro "Matz" Matsumoto
2019-03-02Print length of the `iseq` in code dump header; fix #4304Yukihiro "Matz" Matsumoto
2019-02-27Add newline to warning by `mrb_warn()`KOBAYASHI Shuji
2019-02-25Refactor `src/backtrace.c`KOBAYASHI Shuji
- Move calling `mrb_debug_get_filename()` to after `lineno` check. - Remove unneeded array check in `print_backtrace()`. - Add a few `const` qualifier.
2019-02-18Parenthesize expression to suppress warning; ref #4278Yukihiro "Matz" Matsumoto
2019-02-18Merge pull request #4283 from ↵Yukihiro "Matz" Matsumoto
shuujii/reorder-members-in-struct-backtrace_location Reorder members in `struct backtrace_location`
2019-02-18Reorder members in `struct backtrace_location`KOBAYASHI Shuji
`sizeof(struct backtrace_location)` is 24 bytes -> 16 bytes in LP64 data model etc.
2019-02-18Remove unneeded `memset()` in `src/backtrace.c`KOBAYASHI Shuji
2019-02-17Merge pull request #4279 from dearblue/fix-inline-packed-symbolsYukihiro "Matz" Matsumoto
Fix destroyed "inline packed symbols" on 32 bit mode with `MRB_WORD_BOXING`
2019-02-16Use `const int` instead of `enum`dearblue
2019-02-16Fix inline packed symbols on 32 bit mode with MRB_WORD_BOXINGdearblue
2019-02-16Add length argument for `sym_inline_unpack()`KOBAYASHI Shuji
`sym_inline_unpack_with_bit()` is moved inside of `sym_inline_unpack()` because this is used only one place.
2019-02-15Extract code fragment for unpacking into method in `sym_inline_unpack()`KOBAYASHI Shuji
2019-02-15Merge pull request #4276 from ↵Yukihiro "Matz" Matsumoto
shuujii/use-assert-for-checking-sym-in-sym_inline_unpack Use `mrb_assert()` for checking `sym` in `sym_inline_unpack()`
2019-02-14Use `mrb_assert()` for checking `sym` in `sym_inline_unpack()`KOBAYASHI Shuji
2019-02-14Add `const` to `pack_table` to `src/symbol.c`KOBAYASHI Shuji
2019-02-12Disable `Symbol.all_symbols`.Yukihiro "Matz" Matsumoto
2019-02-12Implement inline packed symbols.Yukihiro "Matz" Matsumoto
Small symbols with all alphanumeric characters (<5) are packed in 32bit symbol integer a la base64. This means those small symbols are not listed in `Symbol.all_symbols`.
2019-02-11Should not copy keys&values when a hash table is empty; fix #4270Yukihiro "Matz" Matsumoto
2019-02-11No strict argument check for blocks when keyword arguments exist; ref #4270Yukihiro "Matz" Matsumoto
2019-02-09`mrb_default_allocf()` is default allocator for NULL safedearblue
2019-02-06Implement symbol hash table to boost `find_symbol`.Yukihiro "Matz" Matsumoto
In 4174e02, we removed the symbol hash table from `mrb_state` but `find_symbol` was too slow with linear search. My performance estimation was wrong. So we implemented a new compact hash table for symbols.
2019-02-06Reduce invocation of `mrb_convert_type()` from `mrb_str_to_str()`.Yukihiro "Matz" Matsumoto
2019-02-06Remove symbol hash table from `mrb_state` structure.Yukihiro "Matz" Matsumoto
Use linear search instead. Number of symbols is usually small (<1K), so we don't need performance boost from hash tables. In our benchmark measurement, hash tables consumes 790KB for `build/full-debug/mrbtest`.
2019-02-05Merge pull request #4262 from shuujii/remove-old-comment-in-symbolYukihiro "Matz" Matsumoto
Remove old comment for `mrb_sym2name_len()` [ci skip]
2019-02-05Remove old comment for `mrb_sym2name_len()` [ci skip]KOBAYASHI Shuji
2019-02-05Fix markup and remove unneeded comment for doc in `src/string.c` [ci skip]KOBAYASHI Shuji
2019-02-04Fix `Symbol#size` for multi-byte characters with `MRB_UTF8_STRING`KOBAYASHI Shuji
Before: p :あ.size #=> 3 After: p :あ.size #=> 1
2019-01-29Remove unused macro in `src/string.c`KOBAYASHI Shuji
2019-01-19Remove `.gitkeep` filesKOBAYASHI Shuji
2019-01-18Merge pull request #4233 from ↵Yukihiro "Matz" Matsumoto
shuujii/remove-special-treatments-for-without-float-in-build-scripts Remove special treatments for `MRB_WITHOUT_FLOAT` in build scripts