| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| | | |
| | | | |
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.
|
|/ / / |
|
|/ /
| |
| |
| | |
.. to ensure it is called exactly once.
|
|\ \
| | |
| | | |
Fix `Type#inspect` to properly display the constant name
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
before:
```ruby
>> FFI::Type::Builtin::CHAR
=> #<FFI::Type::Builtin:INT8 size=1 alignment=1>
```
after:
```ruby
>> FFI::Type::Builtin::CHAR
=> #<FFI::Type::Builtin::INT8 size=1 alignment=1>
```
|
|\ \ \
| |/ /
|/| | |
Implement Write Barrier and dsize for FFI::FunctionType
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Convert FFI::DynamicLibrary to TypedData
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ref: ffi#991
The old untyped DATA API is soft deprecated and
this new one open the door to write barriers, compaction, memsize etc.
|
|/ /
| |
| |
| | |
for completeness even if this code part is commented out
|
|\ \
| | |
| | |
| | | |
casperisfine-typed-data-struct
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Convert FFI::Struct::InlineArray to TypedData
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Convert FFI::Type and descendants to TypedData
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Convert FFI::ThreadData to TypedData
|