| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
(https://github.com/ruby/fiddle/pull/88)
https://github.com/ruby/fiddle/commit/4ee1c6fc4b
|
|
|
|
|
|
| |
FIddle::Handle#to_ptr (https://github.com/ruby/fiddle/pull/87)
https://github.com/ruby/fiddle/commit/170111a0cb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a "pinning" reference
A `Fiddle::Pinned` objects will prevent the objects they point to from
moving. This is useful in the case where you need to pass a reference
to a C extension that keeps the address in a global and needs the
address to be stable.
For example:
```ruby
class Foo
A = "hi" # this is an embedded string
some_c_function A # A might move!
end
```
If `A` moves, then the underlying string buffer may also move.
`Fiddle::Pinned` will prevent the object from moving:
```ruby
class Foo
A = "hi" # this is an embedded string
A_pinner = Fiddle::Pinned.new(A) # :nodoc:
some_c_function A # A can't move because of `Fiddle::Pinned`
end
```
This is a similar strategy to what Graal uses:
https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/PinnedObject.html#getObject--
* rename global to match exception name
* Introduce generic Fiddle::Error and rearrange error classes
Fiddle::Error is the generic exception base class for Fiddle exceptions.
This commit introduces the class and rearranges Fiddle exceptions to
inherit from it.
https://github.com/ruby/fiddle/commit/ac52d00223
|
|
|
|
|
|
|
| |
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
https://github.com/ruby/fiddle/commit/18d6fb6915
|
|
|
|
|
|
|
|
| |
Patch provided by tenderlove and nobu.
* test/fiddle/test_handle.rb (class TestHandle): add test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c
gc.c, io.c, process.c, safe.c, signal.c, win32/file.c:
removed code for $SAFE=2
* test/erb/test_erb.rb, test/fiddle/test_handle.rb
test/ruby/test_env.rb: removed tests for $SAFE=2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* ext/fiddle/handle.c (CHECK_DLERROR): suppress warnings for using
the result of an assignment as a condition without parentheses.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* ext/fiddle/handle.c (rb_fiddle_handle_initialize): suppress an
unused-but-set-variable warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
ext/fiddle/handle.c (fiddle_handle_free),
ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* ext/fiddle/handle.c: [DOC] Document Fiddle::Handle.new(nil)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ext/fiddle/pointer.c: ditto
* ext/fiddle/function.c: ditto
* ext/fiddle/lib/fiddle.rb: ditto
* ext/fiddle/fiddle.c: ditto
* ext/fiddle/handle.c: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|