| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And FFI::StructLayout::Field
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.
I had to get rid of the `memset(0)` in `struct_layout_mark` has with Write Barriers
it's not guaranteed that the layout will be marked before `fieldName` is moved.
I don't think it was a good fix anyway, it's better to mark these VALUE so the GC pin
them. I think we could go back to an `st_table` and mark only the keys with `rb_mark_set`.
But I didn't want to go down this rabbit hole.
|
|
|
|
| |
It makes no sense to initialize the base class with a potentially invalid pointer.
|
|\
| |
| | |
Rename sparc64-linux -> sparcv9-linux
|
| |
| |
| |
| |
| |
| |
| |
| | |
In https://github.com/ffi/ffi/pull/575, 64-bit sparc was changed to also
use sparcv9 as the platform name, but the types.conf directory was never
renamed. This breaks only on Ruby 3.0 and later due to the fileutils
change to use keyword arguments in
https://github.com/ruby/fileutils/commit/482de6d397742526d1111576e2791f9b7051e3c0
|
|\ \
| | |
| | | |
Refactor library lookup
|
| | |
| | |
| | |
| | |
| | | |
* The keys are not used, and the paths are typically already part of the error message.
* Makes it possible to just use a recursive call instead of retry.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Try every prefix, not just the first one where the file exists.
The first existing file might be for the wrong architecture or have
other issues and cannot be loaded.
* Show which directories were searched in error message.
* Only consider /opt/homebrew/lib on darwin-aarch64.
* Only rescue LoadError and RuntimeError, not Exception.
* Refactor in smaller functions to improve readability.
* Fixes #880.
* Example error message:
Could not open library 'notexist': notexist: cannot open shared object file: No such file or directory. (LoadError)
Could not open library 'libnotexist.so': libnotexist.so: cannot open shared object file: No such file or directory.
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
|
|/
|
| |
overriden -> overridden
|
|\
| |
| | |
Add types.conf for loongarch64-linux
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
FFI improvments will probably backported to 9.2 branch.
See https://github.com/jruby/jruby/pull/6747#issuecomment-876610443
|
| |
|
| |
|
|
|
|
|
|
|
| |
Take the same approach for detection as used in fiddle:
https://github.com/ruby/ruby/blob/79717f81f8ba24960cca6c934d00c72db64139ed/test/fiddle/helper.rb#L55-L56
And use "_time" function on all Windows UCRT platforms.
|
| |
|
|
|
|
| |
Same as https://github.com/ffi/ffi/pull/627
|
|\
| |
| | |
dynlib support for homebrew 3 on Apple Silicon M1
|
| |
| |
| | |
As the homebrew team discussed in https://github.com/Homebrew/brew/issues/9177 the new library path for homebrew on apple silicon is `/opt/homebrew/lib`. Alongside the PR to support MacPorts https://github.com/ffi/ffi/pull/638 this commits adds support for the new homebrew path.
|
| | |
|
| |
| |
| |
| | |
`struct_generator.rb`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 195e12f3ee52a8f5620fd8286c2b94737b6b4fc2.
Removing constants is contrary to expectation.
It was introduced to replace Rubinius internal FFI in favor of the gem.
We no longer test on Rubinius and Rubinius seems to be dead.
So we can remove this line.
Fixes 896
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
This file is moved from JRuby to ffi gem as part of
https://github.com/jruby/jruby/pull/6503
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
.. but add test cases for write_sting semantics.
This reverts commit 2b44904f8323dcad3eaa978c1fd2b5298bd04663, reversing
changes made to 2918fdfc7fde6456d5ddc1090a783de0e82d6e39.
Fixes #857
|
| |
|
|\
| |
| | |
Move Pointer#size_limit? to AbstractMemory and from C to ruby
|
| |
| |
| |
| |
| |
| | |
Since size is defined in AbstractMemory, size_limit? should be there as well.
Moving to Ruby code ensures that it works on JRuby and Truffleruby.
|
|/ |
|
|\
| |
| | |
Fix FFI::Pointer#write_string to always terminate with a \0 byte
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
If the string fits into the memory but the final 0-byte doesn't, print a deprecation warning.
This should mitigate the comptibility issue that @eregon noticed in https://github.com/ffi/ffi/pull/806#issuecomment-698357515 .
Also extend the specs for ffi-2.x behavior and the behavior for too large strings.
|
| |
| |
| |
| | |
* And try to improve the clarity of the docs.
|
| |
| |
| |
| |
| |
| |
| | |
When len is given the null character is appended after the truncated string.
Due to discussion in https://github.com/ffi/ffi/pull/806#pullrequestreview-451056095
Also add some Unicode characters to point out we're counting bytes, not characters.
|