Commit Graph

233 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 4a55b42984 O(1) mrb_sym2name_len(); close #2591
instead of adding sym->name hash table, linear symbol table is added, and reduced name->sym hash table size.
2014-09-30 20:15:27 +09:00
Yukihiro "Matz" Matsumoto 6057b2e378 change mrb_sym type from uint16_t to uint32_t 2014-09-15 01:48:08 +09:00
cremno 89b27648dd add symbol table overflow check
Since raising an error might intern a few new strings, some symbols need
to be reserved. 8 should be sufficient.

If the real limit has been reached, mrb_bug() is called.
2014-08-27 12:51:10 +02:00
Jun Hiroe 21f583783d Rename GC_STATE_NONE GC_STATE_ROOT 2014-08-06 22:59:48 +09:00
Yukihiro "Matz" Matsumoto 206f89e209 add MRB_API modifiers to mruby API functions 2014-08-04 00:47:08 +09:00
take_cheeze fc9a91c4a6 Add field allocf_ud to replace current ud.
Since some use it as `mrb_state` associated user data.
2014-07-17 21:48:17 +09:00
Yukihiro "Matz" Matsumoto 4501598f27 use SystemStackError instead of RuntimeError 2014-07-12 21:29:46 +09:00
David Turnbull 249f05e7d7 Clean up value.h and mrb_value boxing 2014-07-09 06:32:11 +09:00
take_cheeze baca365caa rename mrb_open_without_mrbgems to mrb_open_core 2014-06-23 20:06:17 +09:00
take_cheeze 36813c87f6 make default allocf public to use it with mrb_open_without_mrbgems 2014-06-23 20:06:17 +09:00
take_cheeze 6bb56ed920 add mrb_open_without_mrbgems API 2014-06-23 20:06:17 +09:00
take_cheeze 62f41ddd3b Add fixed state atexit stack feature.
Adds following macros:
* MRB_FIXED_STATE_ATEXIT_STACK (not defined by default)
  * When defined enables fixed state atexit stack.
* MRB_FIXED_STATE_ATEXIT_STACK_SIZE (default value: 5)
  * This macro will be ignored when `MRB_FIXED_STATE_ATEXIT_STACK` isn't defined.
  * When `mrb_state_atexit` is called more than this value it will raise runtime error.
2014-06-16 16:03:35 +09:00
Yukihiro "Matz" Matsumoto fe95f44013 rename mrb_atexit to mrb_state_atexit to clarify a func will be called at the end of state, not process; ref #2211 2014-06-10 17:59:56 +09:00
take_cheeze 4de468e754 Fallback to mrb_assert instead of dirty trick. 2014-06-09 18:47:07 +09:00
take_cheeze 4a27dd0e8a Use _Static_assert when C11 is available and use it in pointer size check. 2014-06-08 23:16:51 +09:00
cremno c4c470696b implement ISASCII correctly 2014-06-05 20:18:23 +02:00
Yukihiro "Matz" Matsumoto a763d11490 Merge branch 'atexit' of https://github.com/take-cheeze/mruby into take-cheeze-atexit 2014-06-05 13:22:28 +09:00
Yukihiro "Matz" Matsumoto d62ce565c6 use pre-allocated RuntimeError for out-of-memory 2014-06-04 11:33:15 +09:00
Yukihiro "Matz" Matsumoto 3cbae53541 move prototype of mrb_format() from error.h to mruby.h; ref #2274 2014-05-20 14:53:42 +09:00
Yukihiro "Matz" Matsumoto 190d9ebbe2 should use mrb_type() for the sake of MRB_WORD_BOXING 2014-05-13 21:47:32 +09:00
take_cheeze 64300b2c43 Add API mrb_atexit().
`mrb_final_mrbgems` will be called as mrb_state atexit function.
Maybe useful in #1844.
2014-05-08 22:19:14 +09:00
Yukihiro "Matz" Matsumoto f977772359 new macro mrb_int(mrb,x) to retrieve mrb_int from mrb_value with conversion if needed 2014-05-03 23:45:40 +09:00
Yukihiro "Matz" Matsumoto 48f36d3f0e better integer size assertion suggested by usak 2014-04-25 04:33:08 +09:00
Yukihiro "Matz" Matsumoto 83c1399af0 eliminate plain int except for a few cases like arena_index 2014-04-25 04:01:57 +09:00
crimsonwoods 29e90d0287 Sort out the variables which belongs to 'mrb_callinfo' to improve 'cipush' performance. 2014-04-18 22:04:21 -07:00
Yukihiro "Matz" Matsumoto 3e00684faa resolve conflict 2014-04-16 15:18:52 +09:00
Takeshi Watanabe 824d3450c5 Qualify argv argument of API const. 2014-04-11 20:38:23 +09:00
take_cheeze 9f24cd6d79 Qualify mrb_yield_*'s argv const. 2014-04-10 17:34:38 +09:00
take_cheeze 90d74b99ff Add MRB_TT_HAS_BASIC_P macro to check whether a typetag has MRB_OBJECT_HEADER. 2014-04-09 14:26:26 +09:00
Yukihiro "Matz" Matsumoto bfd2a539ed add new function mrb_toplevel_run to prevent running through C function boudaries on exceptions; close #1942 2014-03-26 01:09:09 +09:00
cubicdaiya 8f8c174fc2 Use MRB_ARGS_REST() instead of ARGS_REST()
According to include/mruby.h,

 /* compatibility macros; will be removed */
 #define ARGS_REST()         MRB_ARGS_REST()
2014-03-23 12:48:34 +09:00
take_cheeze e854a0e850 make Fiber#transfer compatible with CRuby 2014-03-21 22:10:47 +09:00
take_cheeze 272fe3d864 use FiberError in fiber exception raise 2014-03-20 04:38:34 +09:00
Yukihiro "Matz" Matsumoto d9107fd157 Merge pull request #1890 from take-cheeze/fiber_resuming
Revert MRB_FIBER_RESUMED as MRB_FIBER_RESUMING.
2014-03-19 08:59:45 +09:00
Yukihiro "Matz" Matsumoto 9084e03556 rename mrb_yield_internal to mrb_yield_with_class since it's no longer internal 2014-03-19 08:57:54 +09:00
Tomoyuki Sahara 93694fe521 export mrb_yield_internal. 2014-03-19 01:08:01 +09:00
take_cheeze 19c4bf6fcb revert MRB_FIBER_RESUMED as MRB_FIBER_RESUMING to fix recurive resume 2014-03-19 01:05:21 +09:00
Yukihiro "Matz" Matsumoto 792c1add0c string functions arguments changed from mrb_int to size_t that would take strlen() 2014-03-19 00:46:27 +09:00
Yukihiro "Matz" Matsumoto 180b3d5678 change mrb_int to size_t that would take strlen() 2014-03-19 00:17:03 +09:00
cubicdaiya cee152670a unify indent style 2014-03-16 07:44:44 +09:00
Yukihiro "Matz" Matsumoto ef884caca5 Merge branch 'master' of github.com:mruby/mruby 2014-03-15 16:03:21 +09:00
Yukihiro "Matz" Matsumoto 048bca43c9 string length type to be mrb_int 2014-03-15 15:47:21 +09:00
Yukihiro "Matz" Matsumoto c476c1b528 symbol length type to be mrb_int 2014-03-15 15:43:40 +09:00
take_cheeze 62f05614ee Add Fiber's double resume test and fix it. 2014-03-15 15:18:06 +09:00
Yukihiro "Matz" Matsumoto ad04b45e5b Merge pull request #1851 from tmash06/add_include_limit_h
add including limits.h.
2014-03-13 03:09:03 +09:00
tmash06 cfcd2e2dc9 add including limits.h.
Because Android's libc(bionic) defines SIZE_MAX at limits.h.
2014-03-13 02:37:09 +09:00
cremno e4afd5374f add mrb_strlen_lit which makes _lit macros safer
strlen(3) + string literal is usually optimized but strlen(3) doesn't
check if its argument is really a string literal. This is important for
mruby's _static functions to which some _lit macros are expanded (string
literals have static storage). See comment for some additional info.

remove unnecessary parentheses
2014-03-12 17:56:08 +01:00
take_cheeze 78915f9601 support c++ exception 2014-03-01 20:05:29 +09:00
cubicdaiya 67de10bfcb use C style comments instead of C++ style comments
According to CONTRIBUTING.md,

Don't use C++ style comments

 /* This is the prefered comment style */

Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-03-01 03:31:45 +09:00
Yukihiro "Matz" Matsumoto 2c7204fc93 mrb_fiber_yield() is available now; you have to link mruby-fiber mrbgem to use the function; there's no function available to create new fiber from C (countapart of Lua's lua_newthread), but that's because you cannot create a new fiber from C due to mruby C API design limitation. define your method to create fibers in Ruby; close #1269 2014-03-01 00:48:08 +09:00