| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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.
|
|/
|
|
|
| |
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.
|
|\
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|\
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
```
|
|/
|
|
|
|
|
|
|
|
|
| |
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: 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
|
| |/
| |
| |
| |
| |
| |
| | |
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.
|