Junji Sawada
96366117ea
Remove unnecessary header inclusion
2012-07-14 11:39:25 +09:00
Yukihiro Matsumoto
48c73ac630
less <stdio.h>
2012-07-13 10:13:47 +09:00
Masaki Muranaka
611cf71a10
Use mrb_calloc if you want zero cleard buffers.
2012-07-08 11:33:49 +09:00
Masaki Muranaka
a064038d85
Add a check for unsigned integer wrapping.
2012-07-07 12:38:07 +09:00
Masaki Muranaka
47407768fd
Fix underlying bugs. mrb_calloc will be crashed in case "nelem == 0" or "p == NULL"
2012-07-07 12:09:59 +09:00
Masamitsu MURASE
780f54e1eb
Free iv of MRB_TT_DATA instance.
2012-07-01 01:52:37 +09:00
Daniel Bovensiepen
2c8886c80d
Make strucdata optional if ENABLE_STRUCT is activitated
2012-06-29 22:59:53 +08:00
Yukihiro "Matz" Matsumoto
bf747efdd1
Merge pull request #317 from masamitsu-murase/fix_struct_new_gc
...
Fix GC of struct
2012-06-24 06:32:48 -07:00
Yukihiro "Matz" Matsumoto
97c9c859d1
Merge pull request #313 from masamitsu-murase/fix_struct_new
...
Fix Struct#new and GC
2012-06-24 06:11:28 -07:00
Yukihiro Matsumoto
8121e0d354
should mark child env from method (proc) objects
2012-06-24 21:46:24 +09:00
Masamitsu MURASE
e53eea76eb
Modify gc_gray_mark for Struct.
2012-06-24 17:38:20 +09:00
Masamitsu MURASE
9a1f588749
Modify obj_free to free instances of Struct.
2012-06-24 17:29:41 +09:00
Masamitsu MURASE
7778b5ca1c
Implement garbage collection for struct.
2012-06-24 06:28:17 +09:00
Yukihiro Matsumoto
ef50e63a63
remove RuntimeError from mrb_state
2012-06-20 20:43:27 +09:00
Yukihiro Matsumoto
76f7aecff3
use ENABLE/DISABLE instead of INCLUDE for configuration macro names
2012-06-15 15:34:49 +09:00
Yukihiro Matsumoto
1a369de489
remove src/gc.h
2012-06-07 01:18:17 +09:00
Yukihiro Matsumoto
4c01f002fd
mruby/array.h: rename buf to ptr
2012-06-05 23:20:36 +09:00
Yukihiro Matsumoto
e3d17e54f8
mruby/string.h: rename buf to ptr
2012-06-05 23:17:09 +09:00
Yukihiro Matsumoto
f24a52b04a
remove mrb_open NULL check for small test programs. They are only for proof-on-concept test, not production code. Adding precise checks are not needed for those code
2012-06-04 01:46:04 +09:00
Jon
2fff59dc86
Check mrb_open return value for NULL
2012-06-03 11:11:35 -04:00
Yukihiro Matsumoto
e4529c065d
make arrays to share bodies
2012-06-03 23:05:31 +09:00
Yukihiro Matsumoto
597978c169
mrb_malloc/calloc/realloc should call mrb_garbage_collect before returning NULL
2012-06-03 17:34:23 +09:00
Yukihiro Matsumoto
28b9619bb4
should decref shared string body on gc_free
2012-06-03 15:45:06 +09:00
Yukihiro Matsumoto
12d75223d6
make shared string to reference-counted C structure to reduce GC pressure
2012-06-03 07:55:39 +09:00
Yukihiro Matsumoto
e36285769a
new API mrb_gc_protect() to add object to arena
2012-06-01 02:40:52 +09:00
Yukihiro Matsumoto
ae9d9a0781
correctly share string bodies
2012-05-31 22:49:38 +09:00
Yukihiro Matsumoto
326fc888e4
allow string shared body
2012-05-31 19:16:48 +09:00
Yukihiro Matsumoto
64fc4ac332
resolve conflict
2012-05-31 15:32:38 +09:00
Yukihiro Matsumoto
e5d1dd2a8e
MRB_GC_STRESS for GC test
2012-05-30 16:01:48 +09:00
Yukihiro Matsumoto
b662a12ee5
remove spaces after open paren
2012-05-30 14:51:39 +09:00
Yukihiro Matsumoto
c2f427c5ed
mark ci->proc as well
2012-05-30 14:44:33 +09:00
Yukihiro Matsumoto
42b4060c9d
force room in arena before raising arena overflow error
2012-05-29 22:14:32 +09:00
Yukihiro Matsumoto
c87ec7c33b
compact arena before raising exception; also reserve a few slots to allocate exception objects
2012-05-29 10:29:01 +09:00
Yukihiro Matsumoto
ad9e841c53
made mrb_get_args() better (optinal args, type checks); close #173 #176
2012-05-24 01:09:36 +09:00
Yukihiro Matsumoto
4523bee953
cast style consistency
2012-05-23 03:31:55 +09:00
Yukihiro Matsumoto
6e67d83c95
should mark iv from MRB_TT_DATA
2012-05-22 18:36:52 +09:00
Mitchell Blank Jr
9e336b00e5
More C++ compilability work: mrb_obj_alloc void* conversions
...
One of the biggest set of changes needed to make C++ compile, is that you
can't autoconvert "void*" to a different pointer type without a cast (you
can of course, convert pointers *to* "void*"!)
For the first part, convert the users of "mrb_obj_alloc". Since it has
to return something, make it RBasic* (that's what mrb_obj_alloc() is
operating on anyway). This way, even in C you'll get a warning if you
don't cast it.
For places where there are a lot of similar calls to mrb_obj_alloc(),
this can be easily hidden through a macro. I did this in string.c:
#define mrb_obj_alloc_string(mrb) ((struct RString *) mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))
I also updated the mrb_object() macro to also return a RBasic* -- my
previous commit changed that from "void*" -> "RObject*", but I figure
it should be consistent with mrb_obj_alloc()
2012-05-20 09:43:14 -07:00
Yukihiro Matsumoto
e93a17ed78
gc should handle regexp and match objects
2012-05-07 19:19:55 +09:00
Yukihiro Matsumoto
98518795b0
argument type of mrb_gc_free_ht() has changed
2012-05-07 16:59:39 +09:00
Yukihiro Matsumoto
e0460c1157
hash refactored
2012-05-05 08:55:58 +09:00
roco
4ec6d41f16
rm whitespace
2012-04-30 14:29:19 -07:00
Yukihiro "Matz" Matsumoto
2b6be16308
Merge pull request #61 from pbhogan/fix-warnings
...
Fix various warnings
2012-04-27 08:56:39 -07:00
Yukihiro Matsumoto
32db0e5d8c
struct RString member should not be mrb_value
2012-04-28 00:32:34 +09:00
Patrick Hogan
4b99def2ae
Clean up switch statements.
...
Some formatting and add default label to silence warning about unhanded cases.
Signed-off-by: Patrick Hogan <pbhogan@gmail.com >
2012-04-26 08:36:32 -05:00
Patrick Hogan
f41aae73fd
Call dfree member on RData/MRB_TT_DATA when collected
...
Signed-off-by: Patrick Hogan <pbhogan@gmail.com >
2012-04-24 08:39:32 -05:00
Yukihiro Matsumoto
8b367098ac
move header files {irep,dump,cdump,ritehash}.h to /include/mruby
2012-04-24 17:41:28 +09:00
mimaki
c80487561f
Merge branch 'master' of github.com:mruby/mruby
...
Conflicts:
src/variable.c
2012-04-23 11:51:47 +09:00
mimaki
835443614d
add file header
2012-04-23 11:46:16 +09:00
Yukihiro Matsumoto
356788607b
should not free mrb stack; a bug found&fixed by @miura1729
2012-04-20 18:54:54 +09:00
Yukihiro Matsumoto
d1144220cb
move src/mdata.h to include/mruby/data.h
2012-04-20 17:18:30 +09:00