Commit Graph

187 Commits

Author SHA1 Message Date
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
Tomoyuki Sahara 50ef284015 include mruby/version.h in mruby.h 2014-02-12 10:26:19 +09:00
Miura Hideki 5df82e357c Store raw stack address in callinfo instead of offset from stbas 2014-02-09 16:42:25 +09:00
Yukihiro "Matz" Matsumoto d8a5f12053 forget to add function prototypes 2014-02-08 13:56:15 +09:00
Yukihiro "Matz" Matsumoto ed1bf9aa80 introduce mrb_str_new_lit() to create strings from C string litrals 2014-02-06 07:50:34 +09:00
Yukihiro "Matz" Matsumoto 4e2a9509dc Merge pull request #1669 from cremno/copyright-2014
update copyright year
2014-01-31 00:01:09 -08:00
Yukihiro "Matz" Matsumoto 210e7b668e Merge pull request #1668 from cremno/etc-c-cleanup
etc.c: small cleanup
2014-01-31 00:00:41 -08:00
cremno eaf445ea5c mruby.h: remove mrb_str_format declaration
The function mrb_str_format is only defined when the mrbgem mruby-sprintf was
activated. That might not always be the case (by default it currently is).
mrb_str_format still has external linkage, so from now on mrbgem authors
have to declare it in their source code if they want or need to call it.
2014-01-30 23:50:18 +01:00
cremno 3ee946dab4 Happy new year! (update copyright year)
Let's not wait until May this time
(f0a9b95af3)!
2014-01-30 23:17:24 +01:00
cremno d90f52f552 etc.c: small cleanup (delete unused functions)
mrb_data_object_alloc: unnecessary cast
mrb_lastline_get: mruby doesn't support $_, weird and unused code
mrb_exec_recursive: see 4e46abb869
mrb_block_proc: unused, doesn't really do anything (or needs to be
rewritten)
mrb_obj_to_sym: actually use id (and MSVC detected unreachable code)
2014-01-30 23:16:46 +01:00
Yukihiro "Matz" Matsumoto e0e5aebc66 add callback invocation from OP_DEBUG 2014-01-23 15:08:38 +09:00
Yukihiro "Matz" Matsumoto c6ceed22d9 rename mrb_intern_litral -> mrb_intern_static 2013-12-25 08:40:26 +09:00
Yukihiro "Matz" Matsumoto bc7a6e88a1 zero copy C literal strings in symbol table 2013-12-24 08:27:42 +09:00
crimsonwoods 370ad6fade Remove 'mrb_state' field from 'kh_xxx_t' structure.
'kh_xxx_t' requires 'mrb_state' to allocate, free, and compute hash value.
But 'mrb_state' should not be held by 'kh_xxx_t' and 'mrb_state' should be
supplied from outside.
2013-12-23 00:33:07 -08:00
take_cheeze df780ae5e9 add mrb_intern_lit for creating symbol from string literal 2013-12-01 10:38:59 +09:00
Yukihiro "Matz" Matsumoto 9c6398a444 rename mrb_intern2() to mrb_intern(); huge API incompatibility; close #1513 2013-11-29 08:47:28 +09:00
Yukihiro "Matz" Matsumoto 07b8a5b042 Make mrb->arena variable sized. Use MRB_GC_FIXED_ARENA for old behavior.
You will not see "arena overflow" error anymore, but I encourage gem authors
to check your gems with MRB_GC_FIXED_ARENA to avoid memory broat.
2013-11-22 09:20:06 +09:00
Tomoyuki Sahara 1e89fc8240 declare struct mrb_irep. 2013-11-21 13:35:46 +09:00
Yukihiro "Matz" Matsumoto c8936754e8 wrong return value from read_lineno_record() 2013-11-07 08:20:03 +09:00
Yukihiro "Matz" Matsumoto e92d4e2680 modified to use irep->reps to reference child ireps. preparation for
removing irep array from mrb_state.  note that instructions OP_LAMBDA,
OP_EXEC and OP_EPUSH are incompatible, and dumped mrb format has changed.
2013-11-07 03:54:22 +09:00
fleuria a511957ec8 refactor mrb_context_run() 2013-11-03 12:05:25 +08:00
fleuria d75a907edf introduce mrb_context_run()
currently there are two scnenario to call mrb_run(), the first is
calling a proc, in this case mrb should create a new environment,
discarding all the variables except args, reciever and block.

the second is calling the newly generated irep, like in mirb.
in this case, the variables should be kept after mrb_run().
so we introduce mrb_context_run() to handle this seperately.
2013-11-03 11:32:59 +08:00
Yukihiro "Matz" Matsumoto a7c9a71684 better error position display 2013-10-15 12:49:41 +09:00
Dusan D. Majkic 1228415c97 Remove function delaration not implemented in code 2013-09-28 22:10:44 +02:00
Yukihiro "Matz" Matsumoto 9194047791 change type of mrb->c->status from uint8_t to enum mrb_fiber_state; #1511 2013-09-25 02:39:59 +09:00
take_cheeze d12b6ab218 add verbose_backtrace 2013-09-02 00:48:06 +09:00
Paolo Bosetti 51c51290d2 Removed unnecessary #undef ISPRINT in include/mruby.h 2013-08-29 18:56:11 +02:00
Dusan D. Majkic e2bdd8cd47 Remove function delarations not implemented in code 2013-08-27 14:57:36 +02:00
Yukihiro "Matz" Matsumoto 6e978d5574 add compatibility macro mrb_class_new_instance() 2013-08-15 00:11:17 +09:00
Yukihiro "Matz" Matsumoto 6b015ec775 define Class#new in ruby to call #initialize 2013-08-13 16:55:06 +09:00
fleuria e2d36d1336 introduce mrb_assert() in mruby.h 2013-07-25 02:53:53 +08:00
Yukihiro "Matz" Matsumoto 4ad4ce6caf restore once removed mrb_garbage_collect() 2013-07-24 23:31:46 +09:00
Yukihiro "Matz" Matsumoto e1706e65f9 Merge pull request #1407 from Fleurer/gc-introduce-incremental-gc-step
separate out `incremental_gc_step()` from `mrb_incremental_gc()`, and misc minor rename
2013-07-24 07:18:50 -07:00
fleuria 2591922ec2 rename variable_gray_list to atomic_gray_list 2013-07-24 18:22:53 +08:00
fleuria c852626ea7 rename mrb_garbage_collect() to mrb_full_gc() 2013-07-24 16:17:53 +08:00
Jun Hiroe 8e42868600 Repalace int with mrb_bool because a return value is boolean. 2013-07-15 23:17:12 +09:00
Jun Hiroe efac8db674 Replace int with mrb_bool because a return value is boolean. 2013-07-14 23:51:44 +09:00
Kazuki Tsujimoto 8ab83f763d Change parameter type to suppress -Wsign-compare warnings 2013-07-07 14:18:37 +09:00
Jun Hiroe f40bd6cb47 Add comments in mrb_state struct. 2013-07-04 21:17:20 +09:00
h2so5 3f823a0cee Add mrb_class_get_under() 2013-07-01 11:50:13 +09:00
fleuria 68f31e94f5 refactor mrb_realloc()
remove the redundant codes with mrb_malloc_simple()
2013-06-28 23:15:31 +08:00
Yukihiro "Matz" Matsumoto 3ceeb0be95 add mrb_malloc_simple() that returns NULL on error 2013-06-25 15:38:28 +09:00
Yukihiro "Matz" Matsumoto 4e877bc92f restructure header files; move non config lines away from mrbconf.h 2013-06-10 14:40:32 +09:00
Yukihiro "Matz" Matsumoto 7b8ae1b8b6 Merge branch 'master' of github.com:mruby/mruby 2013-05-26 21:27:16 +09:00
kimu_shu e720782f81 Add MRB_WORD_BOXING mode (represent mrb_value as a word) 2013-05-26 10:09:17 +09:00
Yukihiro "Matz" Matsumoto 6557ee938a mruby error messages should be directed to stderr 2013-05-26 02:13:02 +09:00
Yukihiro "Matz" Matsumoto 76ddf86c72 manage fiber status (create|running|resumed|terminated) 2013-05-23 15:24:31 +09:00