| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Add support for passing ABI version to `FFI.map_library_name`.
|
| | |
|
|\ \ |
|
| | |
| | |
| | |
| | | |
..until necessary native methods are added.
|
| | | |
|
| | |
| | |
| | |
| | | |
For consistency and to ease proting to JRuby and Truffleruby.
|
| | |
| | |
| | |
| | | |
of commit e987ab50366a4b08617a20568eabdaa1fb761317
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
definitions Ractor usable
Freeze objects which are immutable from the start are now freezed.
This allows these objects to be used by Ractor without make_shareable.
This partially reverts commit 4fc6a8c5ec8a9a720330946af9d1103015c62942 in such a way, that functions are stored in a module variable @ffi_functions.
Enums are implemented per FFI::Library not per attached function.
To make them shareable they would have to be copied and freezed per function.
This would increase memory footprint for the sake of Ractor support.
IMHO it's better to mark the module explicit as finished by .freeze to allow its use in a Ractor.
This also enables querying the enum definitions from a Ractor.
Using a Hash instead of per-function variables allow to use foo! and bar? methods as wished in #971.
Fixes #971
|
| | | |
|
| | |
| | |
| | |
| | | |
And remove support for older rubies.
|
| | |
| | |
| | |
| | |
| | | |
Shareable instance variables on modules are essential for most Ractor specs.
They were introduced in ruby-3.1.
|
| | |
| | |
| | |
| | |
| | | |
The term "return_type" is already used in Truffleruby and sounds better to me.
On the other hand the term "result_type" was only used in C-ffi as FunctionInfo#result_type, which is an internal class only.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
attached
This allows to freeze the FFI::Function immediately, so that it is shareable by Ractor without the need to freeze the module explicit.
To make it shareable the typedef hash used for variadic functions is duplicated and made frozen.
This creates a small compatibility issue:
Only typedefs defined above the variadic function can be used by that function.
If a typedef is created after the definition of the variadic function, then this typedef can no longer be used as parameter to that variadic function.
Also fix the retrieval of simple (non-struct) global variables per #attached_variables.
Closes #975
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
.. and test Ractor compatibility there.
|
| | |
| | |
| | |
| | | |
It is incompatible to our usage of instance variables by the Struct class.
|
| | |
| | |
| | |
| | | |
since there's no need to modify it later on
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ractor-local custom typedefs are used now, since global writable typedefs aren't compatible with Ractor isolation.
Now the builtin typedefs are frozen and available for all Ractors.
But all custom typedefs are only per Ractor.
Actually the global typedefs already were useable in Ractors, if they are resolved in C code.
This is because the C code doesn't check the Ractor boundaries.
|
| | |
| | |
| | |
| | | |
No need to share per thread data object accross ractors.
|
| | |
| | |
| | |
| | |
| | | |
The callback is now routet to the Ractor, that created the FFI::Function .
Within this Ractor a new ruby thread is created to execute the Proc, like before.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
All objects are shareable now when frozen.
All objects can be created in a non-main Ractor.
Typedefs are a global mutable state and are not accessable from Ractor other than the main Ractor.
So all Function, Struct, etc. must be defined in the main Ractor and can then be used in other Ractors.
|
|\ \ \
| | | |
| | | | |
Remove no longer used StructField.get and .put
|
|/ / /
| | |
| | |
| | |
| | | |
It was introduced in commit 9d68c7f87ad7c869ee1ce3139269525af70e5df4 but moved to ruby code in commit 3f96bbb61b2f17ba9761a1d02745101a60cd26e1 .
These fields are a leftover from the commit.
|
|\ \ \
| | | |
| | | | |
Allow private release method for ManagedStruct and AutoPointer
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
FFI users might not want to expose `release` as a public class method, but want to keep it private.
Also re-enable GC tests that were disabled as part of #427, but make them opt-in per env var FFI_TEST_GC.
Derivations of Releaser are no longer necessary, so that they are removed now.
|
|\ \ \
| | | |
| | | | |
MSVC Test Support
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Instead, the function pointers must be a typdef. For what its worth, see https://stackoverflow.com/a/37114318.
|
|/ / /
| | |
| | |
| | | |
compiling with MSVC 22. These apis take a widechar - LPCWSTR. Thus these tests fail because Windows considers the pipe names to be invalid. Thus switch to the Ansi versions.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Use libffi closure allocations on hppa
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We currently do this for Apple arm64, but we need to do it for hppa too. The test
suite passes for both ffi and dependent gems with this. Previously they would
segfault.
|
|\ \ \ \
| | | | |
| | | | | |
Free Allocated Buffer
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Windows - Update LoadLibrary Error Message to include Error Code
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
trying to load a 32bit dll from a 64 bit program (garbage.so in the test suite). Since the passed in buffer contains junk data the resulting error message full of garbage characters which makes it impossible to know what the problem is.
This commit updates the message so that it at least returns the error code (in this case 193) which makes it possible to debug the problem.
|
|\ \ \ \
| | | | |
| | | | | |
Remove use of RARRAY_PTR
|
| | |/ /
| |/| |
| | | |
| | | |
| | | | |
RARRAY_PTR is bad for GC performance as it exposes the internal buffer
of the array meaning that the array becomes write barrier unprotected.
|
|\ \ \ \
| |/ / /
|/| | | |
Remove old definitions in compat.h for Ruby 1.x
|
|/ / /
| | |
| | |
| | |
| | | |
These definitions all exist in all recent versions of Ruby, so it's dead
code that we can remove.
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
It is not used in C or Ruby code.
|
|\ \ \ \
| |/ / /
|/| | | |
Add types.conf for sw_64-linux
|
| |/ / |
|
| | |
| | |
| | |
| | | |
It was not yet tested.
|