| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
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.
|
|\ \
| | |
| | | |
Make FFI classes GC.compact friendly
|
| |/
| |
| |
| |
| |
| | |
This allows to relocate all FFI objects.
Also remove marking of StructLayout->cache_row in favour of clearing it at GC.compact only.
|
|\ \
| | |
| | | |
Update libffi
|
| | |
| | |
| | |
| | |
| | |
| | | |
This is because libffi changed the way how closures are allocated to static trampolines.
`codeloc` is an opaque pointer now, to the internal `struct tramp` struct - and not to executable code.
The executable code of trampolines is static and no longer written or writable at runtime.
|
| |/ |
|
|/ |
|
|\
| |
| | |
Update gen/Rakefile for Ruby 3 compat
|
|/
|
|
|
|
|
| |
Ruby 3 changed the 'mode' argument from an option hash to keyword
argument. This change is backwards-compatible with Ruby 2.
See: https://github.com/ruby/fileutils/commit/482de6d397742526d1111576e2791f9b7051e3c0
|
|\
| |
| | |
Use type checking by TypedData and remove duplocated check by rb_obj_is_kind_of
|
| |
| |
| |
| | |
This is now possible with new typed data objects.
|
|\ \
| | |
| | | |
Remove allocator of AbstractMemory
|
| |/
| |
| |
| |
| |
| | |
This disables AbstractMemory.new, which has no practical use.
As discussed in #1010
|
|\ \
| |/
|/| |
Implement the last missing Write Barriers and dsize
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ref: https://github.com/ffi/ffi/pull/991
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. It's not counting everything
because some types are opaque right now, so a larger refactoring would be needed.
|
|\
| |
| | |
Implement Write Barrier and dsize for FFI::Pointer
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As well as FFI::MemoryPointer and FFI::AbstractMemory
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.
|
|\ \
| |/
|/|
| | |
https://github.com/casperisfine/ffi into casperisfine-struct-layout-write-barrier
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Implement Write Barrier and dsize for FFI::StructByValue
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Implement Write Barrier and dsize for FFI::VariadicInvoker
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Implement Write Barrier and dsize for FFI::Struct
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
And FFI::Struct::InlineArray.
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.
|
|\ \ \
| |_|/
|/| | |
Implement Write Barrier and dsize for FFI::Type
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ref: https://github.com/ffi/ffi/pull/991
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.
While I was at it I removed the `strdup` of `BuiltinType.name`,
I don't see why we wouldn't directly point at static memory, that
saves copying type names, and makes freeing builtin types easier.
|
|\ \ \ |
|
| |\ \ \
| | | | |
| | | | | |
Implement Write Barrier and dsize for FFI::DynamicLibrary
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
And FFI::DynamicLibrary::Symbol
Ref: https://github.com/ffi/ffi/pull/991
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. It's not counting everything
because some types are opaque right now, so a larger refactoring would be needed.
While I was at it, I moved `Symbol.library` into the unused `Symbol.base.rbParent`
which seemed appropriate and saves a pointer.
|
|\ \ \ \
| |/ / / |
|
| |\ \ \
| | |_|/
| |/| | |
Implement Write Barrier and dsize for FFI::Function
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ref: https://github.com/ffi/ffi/pull/991
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. It's not counting everything
because some types are opaque right now, so a larger refactoring would be needed.
|