| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This allows to relocate all FFI objects.
Also remove marking of StructLayout->cache_row in favour of clearing it at GC.compact only.
|
|
|
|
| |
.. to ensure it is called exactly once.
|
|
|
|
|
|
|
|
|
|
|
| |
Write barrier protected objects are allowed to be promoted to the old generation,
which means they only get marked on major GC.
The downside is that the RB_BJ_WRITE macro MUST be used to set references,
otherwise the referenced object may be garbaged collected.
This commit also implement a `dsize` function so that these instance
report a more relevant size in various memory profilers.
|
|
|
|
|
|
|
| |
Ref: https://github.com/ffi/ffi/pull/991
The old untyped DATA API is soft deprecated and
this new one open the door to write barriers, compaction, memsize etc.
|
|
|
|
|
|
|
|
| |
Only very old Visual-C compilers before 2010 didn't contain these files.
Since the copyright of the included files conflicts with ffi's license,
we better remove it.
Fixes #693
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callbacks returning a :string type were not supported so far and did not work.
It was possible to define such a callback, but the value returned was NULL in any case.
This implementation rejects :string return type of callbacks at the definition.
The reason for the reject is the following:
In contrast to :string parameters to called functions there is no well defined ownership of the memory of the string returned by callbacks.
Instead an explicit FFI::MemoryPointer or similar should be used, which allows to track the validity of underlying memory instead of relying on some Ruby implementation details.
Fixes #751
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 9f257af19e6088c2986f85dea17455e52a2be405.
This is due to issues with callback in combination with fork() on Centos.
See https://github.com/ffi/ffi/issues/621 .
It is caused by specialized handling of callback allocation on SE-Linux
protected systems through ffi_closure_alloc(), which is incompatible to fork().
Reverting this now, pending more investigation, how we can solve callback
allocation in a way that is compatible to both PaX and SE-Linux.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes ClosurePool. It has been switching pages protection between
writable and executable, which was making it incompatible with PaX
MPROTECT.
libffi instead leaves its closures (closure trampolines) non-executable,
relying on PaX to recognize and emulate them, which allows it to work
even under such circumstances.
Remove CUSTOM_TRAMPOLINE and USE_RAW to avoid ifdef hassle.
|
|
|
|
|
| |
FFI_STDCALL is no define, so stdcall was never used.
This fixes issue #302 and adds a test case for stdcall callbacks..
|
| |
|
| |
|
|
|
|
| |
mistakenly removed, and add it to those that had contributions under that license.
|
| |
|
| |
|
| |
|
|
|
|
| |
VMs that do not have it.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
ext/ffi_c/MemoryPointer.c
lib/ffi/struct.rb
|
| | |
|
|/ |
|
|
|
|
| |
and ConstGenerator.
|
|
|
|
| |
Library, Platform and FFI class methods from types.rb.
|
| |
|
| |
|
|
|
|
| |
Fix libtest compilation issues on windows
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
ffi_type
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|