Commit Graph

16879 Commits

Author SHA1 Message Date
John Bampton 781edbd446 misc: fix spelling 2025-05-14 02:01:02 +10:00
Yukihiro "Matz" Matsumoto 93a7e5ec26 Merge pull request #6526 from vickash/luckfox-pico 2025-05-13 16:46:23 +09:00
Yukihiro "Matz" Matsumoto 75466f9aab mruby-compiler: use mrb_basic_alloc_func() directly from compiler
As a side effect, memory allocation failure may cause segmentation
fault. Maybe we have to add error detection later.
2025-05-13 13:20:06 +09:00
Yukihiro "Matz" Matsumoto 9ef2f551b7 mruby-compiler: use new mempool API 2025-05-13 08:13:48 +09:00
Yukihiro "Matz" Matsumoto dbc9d12254 mempool.c (mempool_open): avoid using old API in mempool.c 2025-05-12 13:04:22 +09:00
Yukihiro "Matz" Matsumoto ebca0cbf6a Merge pull request #6525 from hasse09052/skip-empty-mirb-history 2025-05-12 12:59:28 +09:00
Yukihiro "Matz" Matsumoto c2d5a402ba compile.h: change struct mrb_mempool to mrb_mempool
So that compatibility layer can be used without macro definition.
2025-05-12 12:30:15 +09:00
vickash 6700c327ac Luckfox Pico config: Use realpath, comment flags and cmath exclusion 2025-05-11 23:25:32 -04:00
vickash f98a05c738 Add build config for Luckfox Pico embedded SBC 2025-05-11 22:35:05 -04:00
Yukihiro "Matz" Matsumoto 6566099dbb mempool.c: remove mrb_state dependency from mempool library
mempool.h provide compatibility layer so that existing programs does not
need to update (but update recommended anyway, since compatibility layer
takes mrb_state that is not used at all).
2025-05-12 08:26:18 +09:00
Yukihiro "Matz" Matsumoto 6766fcb905 class.c (mt_rehash): Fix mrb_calloc argument order
Since mrb_calloc() (along with mrb_calloc) takes two arguments: nmemb
which is number of array elements, and size which is size of the array.
Of course, revsersing does not change the behavior, but we'd like to
respect the original design intention of calloc(3).
2025-05-11 20:11:56 +09:00
Yukihiro "Matz" Matsumoto 4704a7700a Merge pull request #6521 from jbampton/add-codespell-config 2025-05-11 20:09:25 +09:00
hasse 6df8096af2 mruby-bin-mirb: skip adding empty input to mirb history 2025-05-11 02:44:04 +09:00
Yukihiro "Matz" Matsumoto c6e3ae7e74 doc/guides/memory.md: update the document
- new API
- detailed hook description
- migration path from old API
2025-05-10 09:34:20 +09:00
Yukihiro "Matz" Matsumoto 7e4810658e allocf.c: update and enhance documentation in the comment 2025-05-10 09:07:35 +09:00
Yukihiro "Matz" Matsumoto 5522c94bb3 mruby.h: remove mrb_allocf type
As a result, we removed (already obsoleted) `mrb_open_allocf()', and
made `mrb_open_core()` take no argument. [incompatible changes]
2025-05-10 08:59:18 +09:00
Yukihiro "Matz" Matsumoto 5c71681d82 allocf.c (mrb_basic_alloc_func): remove ud argument 2025-05-10 08:59:18 +09:00
Yukihiro "Matz" Matsumoto c3cc559dfc allocf.c: rename mrb_default_alloc to mrb_basic_alloc_func
Along with removing mrb_state first argument from the function. From
mruby 3.2, this function is *not* the default function, but the entry
point that can be redefined for the application. The function in
`src/allocf.c` is the default *implementation* (using malloc / realloc /
free) of the function.
2025-05-09 21:50:18 +09:00
John Bampton f515669ce3 Add codespell config file .codespellrc
Add `.codespellrc` to the GitHub labeler

Can now run codespell from the command line standalone and it will use
our standard config file. Running codespell with pre-commit will also use this config.

Useful when regenerating the ignored words file on the command line.

https://github.com/codespell-project/codespell?tab=readme-ov-file#using-a-config-file

https://github.com/codespell-project/codespell?tab=readme-ov-file#pre-commit-hook
2025-05-09 20:54:27 +10:00
Yukihiro "Matz" Matsumoto 0bdd529430 mruby.h: remove allocf and allocf_ud from mrb_state
This is preparation for memory allocation restructuring.
2025-05-09 18:13:28 +09:00
Yukihiro "Matz" Matsumoto 3d2f848e64 mruby-random: Random#rand(nil) should raise TypeError 2025-05-08 17:37:05 +09:00
Yukihiro "Matz" Matsumoto 88e86ee62e mruby-random: update error messages to be compatible with CRuby; #6523 2025-05-08 16:42:33 +09:00
Yukihiro "Matz" Matsumoto 21d6bfb6dd test/kernel.rb: disable some Kernel#p tests; ref #6524 2025-05-08 16:21:01 +09:00
Yukihiro "Matz" Matsumoto 37b84f40e0 Merge pull request #6523 from leviongit/rand-range 2025-05-08 16:06:02 +09:00
Yukihiro "Matz" Matsumoto 5b10fdf684 Merge pull request #6524 from hasumikin/fix/Kernel#p 2025-05-08 16:01:35 +09:00
Yukihiro "Matz" Matsumoto 147af9d669 Merge pull request #6522 from jbampton/label-more-files 2025-05-08 15:59:47 +09:00
Yukihiro "Matz" Matsumoto 3879b95a62 class.c (find_visibility_scope): when callinfo returns, *ep == NULL; #6512 2025-05-08 12:02:32 +09:00
Yukihiro "Matz" Matsumoto 2b0d866da1 class.c (find_visibility_scope): rename the function; ref #6512
Since the function returns either callinfo or env, thus the name does
not describe the current behavior. In addition, we did some refactoring
on the function.
2025-05-08 12:02:00 +09:00
Yukihiro "Matz" Matsumoto 50c8e180d8 class.c (find_visibility_ci): refactor to reduce complexity; ref #6512 2025-05-08 07:57:35 +09:00
Yukihiro "Matz" Matsumoto dbc4768758 mruby/internal.h: rename visibility separation macros; ref #6512 2025-05-08 07:32:36 +09:00
Yukihiro "Matz" Matsumoto c9a36e5d39 mruby/value.h: rename flag check macros; ref #6512 2025-05-08 07:27:30 +09:00
Yukihiro "Matz" Matsumoto 41e91a2ca8 vm.c (mrb_exec_irep): remove recently added separate_module argument
The argument was added in #6512
2025-05-08 07:27:23 +09:00
Yukihiro "Matz" Matsumoto ef0cbc2981 mruby-eval (exec_irep): cache mrb->c->ci to a local variable 2025-05-07 23:30:41 +09:00
Yukihiro "Matz" Matsumoto 567617ceb5 Merge branch 'dearblue-visibility' 2025-05-07 15:37:37 +09:00
Yukihiro "Matz" Matsumoto aec8d0c58b Merge branch 'visibility' of github.com:dearblue/mruby into dearblue-visibility 2025-05-07 15:37:08 +09:00
Yukihiro "Matz" Matsumoto 81f5f5b8d4 mruby-bin-debugger: should not use Exception#inspect to print errors
Use mrb_exc_get_output() instead.
2025-05-07 12:34:13 +09:00
Yukihiro "Matz" Matsumoto c36d9b7732 mruby-bin-mirb: should not use Exception#inspect to print errors
Use mrb_exc_get_output() instead.
2025-05-07 12:32:12 +09:00
Yukihiro "Matz" Matsumoto 6eb969ff04 backtrace.c (print_backtrace): use mrb_exc_get_output()
To keep the old error print even after Exception#inspect format changed.
2025-05-07 12:22:11 +09:00
Yukihiro "Matz" Matsumoto 33d9ad6c44 error.c (mrb_exc_get_output): a new function for old inspect format 2025-05-07 12:19:05 +09:00
Yukihiro "Matz" Matsumoto 85d048c1fb mruby-error: update tests for new Exception#inspect format 2025-05-07 12:19:05 +09:00
Yukihiro "Matz" Matsumoto a87b4b6bc3 test/exception.rb: update for new Exception#inspect 2025-05-07 12:19:05 +09:00
Yukihiro "Matz" Matsumoto 333c364d5f error.c (mrb_exc_inspect): Update format to match CRuby 2025-05-07 12:19:04 +09:00
Yukihiro "Matz" Matsumoto b5ad35d8ef proc.h (MRB_SET_VISIBILITY_FLAGS): rename macro 2025-05-07 12:19:04 +09:00
Yukihiro "Matz" Matsumoto 0da5e0e190 AUTHORS: update entries [ci skip] 2025-05-07 12:19:04 +09:00
Yukihiro "Matz" Matsumoto abfef2c38d Merge pull request #6520 from jbampton/update-pre-commit 2025-05-04 23:19:54 +09:00
leviongit 7be940942c random.c : treat ranges where r.begin > r.end the same way cruby does 2025-05-04 04:10:39 +02:00
leviongit 98906d5ac9 random.c : fix Random#rand not returning value 2025-05-04 03:48:22 +02:00
HASUMI Hitoshi fdfd67ff40 Fix Kernel#p when no argument
## Expected
```ruby
p
=> nil
```

## Actual
```ruby
p
=> []
```
2025-05-04 10:17:37 +09:00
leviongit 202c213fe1 random.c : add some tests 2025-05-04 02:44:19 +02:00
leviongit 4390aeb78d random.c : add rand(Range) 2025-05-04 02:44:19 +02:00