Permalink
Browse files

Rework capi Handles entirely

Handles are now full C++ objects and are integrated with the GC. Handles
contain a reference count to indicate if there are any strong references
to them, ie, should the Handle keep the object alive.

If the Handle is weak, it will not attempt to keep the object alive, but
it will make sure that it stays up to date with the object as it
continues to live.

This allows us to have constant memory location Handles for objects that
move around, without having handle temporal locality problems like the
previous implementation.
  • Loading branch information...
1 parent aa660db commit 4c6a1efb16afc006fbcaff727b2e6315f5d4d264 Evan Phoenix committed Apr 22, 2009
@@ -211,7 +211,6 @@ GetVpValue(VALUE v, int must)
case T_DATA:
if(RDATA(v)->dfree ==(void *) BigDecimal_delete) {
Data_Get_Struct(v, Real, pv);
- pv->obj = v;
return pv;
} else {
goto SomeOneMayDoIt;
View
@@ -136,6 +136,7 @@ field_extract_headers = %w[
vm/builtin/proc.hpp
vm/builtin/variable_scope.hpp
vm/builtin/location.hpp
+ vm/builtin/capi_handle.hpp
]
BC = "vm/instructions.bc"
View
@@ -20,7 +20,7 @@ def compile_extension(path, name)
# TODO use Tap; write a common ext build task
if RUBY_NAME == 'rbx'
- `./bin/rbx compile -I#{Rubinius::HDR_PATH} #{source}`
+ `./bin/rbx compile -I#{Rubinius::HDR_PATH} -C,-ggdb #{source}`
elsif RUBY_NAME == 'ruby'
cc = Config::CONFIG["CC"]
hdrdir = Config::CONFIG["archdir"]
View
@@ -34,7 +34,14 @@ class MSpecScript
'^library/rubygems',
]
- set :capi, [ 'spec/capi' ]
+ set :capi, [
+ 'spec/capi',
+ '^spec/capi/globals',
+ '^spec/capi/language',
+ '^spec/capi/module',
+ '^spec/capi/proc',
+ '^spec/capi/struct'
+ ]
set :compiler, [ 'spec/compiler' ]
Oops, something went wrong.

0 comments on commit 4c6a1ef

Please sign in to comment.