summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add some tests to verify that GC.compact worksLars Kanis2023-04-201-0/+66
|
* Merge pull request #1017 from thesamesam/hppaLars Kanis2023-04-203-0/+357
|\ | | | | Use libffi closure allocations on hppa
| * Add types.conf for hppa1.1-linuxSam James2023-04-121-0/+178
| |
| * Add types.conf for hppa2.0-linuxSam James2023-04-121-0/+178
| |
| * Use libffi closure allocations on hppaSam James2023-04-121-0/+1
| | | | | | | | | | | | 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.
* | Merge pull request #1027 from cfis/masterLars Kanis2023-04-201-0/+3
|\ \ | | | | | | Free Allocated Buffer
| * | Free the message allocated by FormatMessageA (should have been in last commit).Charlie Savage2023-04-201-0/+3
|/ /
* | Merge pull request #1026 from cfis/masterLars Kanis2023-04-201-2/+10
|\ \ | | | | | | Windows - Update LoadLibrary Error Message to include Error Code
| * | On Windows FormatMessageA can return a NULL message - for example when ↵Charlie Savage2023-04-191-2/+10
|/ / | | | | | | | | | | 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.
* | Merge pull request #1025 from peterzhu2118/pz-rarray-ptrLars Kanis2023-04-192-2/+2
|\ \ | | | | | | Remove use of RARRAY_PTR
| * | Remove use of RARRAY_PTRPeter Zhu2023-04-182-2/+2
| | | | | | | | | | | | | | | RARRAY_PTR is bad for GC performance as it exposes the internal buffer of the array meaning that the array becomes write barrier unprotected.
* | | Merge pull request #1024 from peterzhu2118/pz-old-compatLars Kanis2023-04-191-23/+0
|\ \ \ | |/ / |/| | Remove old definitions in compat.h for Ruby 1.x
| * | Remove old definitions in compat.h for Ruby 1.xPeter Zhu2023-04-181-23/+0
|/ / | | | | | | | | These definitions all exist in all recent versions of Ruby, so it's dead code that we can remove.
* | Merge branch 'remove-sizetypes'Lars Kanis2023-04-181-16/+13
|\ \
| * | Remove unused FFI::SizeTypesLars Kanis2023-04-181-16/+13
| | | | | | | | | | | | It is not used in C or Ruby code.
* | | Merge pull request #1018 from F16shen/masterLars Kanis2023-04-171-0/+141
|\ \ \ | |/ / |/| | Add types.conf for sw_64-linux
| * | Add types.conf for sw_64-linuxlixin2023-04-111-0/+141
| |/
* | Add a spec that adds one Function to several modulesLars Kanis2023-04-161-0/+10
| | | | | | | | It was not yet tested.
* | Merge pull request #1021 from larskanis/compactLars Kanis2023-04-1613-37/+197
|\ \ | | | | | | Make FFI classes GC.compact friendly
| * | Make FFI classes GC.compact friendlyLars Kanis2023-04-1413-37/+197
| |/ | | | | | | | | | | This allows to relocate all FFI objects. Also remove marking of StructLayout->cache_row in favour of clearing it at GC.compact only.
* | Merge pull request #1020 from larskanis/update-libffiLars Kanis2023-04-162-1/+3
|\ \ | | | | | | Update libffi
| * | Disable custom trampoline when using libffi closure allocationLars Kanis2023-04-141-1/+3
| | | | | | | | | | | | | | | | | | 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 libffi to latest masterLars Kanis2023-04-141-0/+0
| |/
* | Update "rake clean" for ruby-3Lars Kanis2023-04-141-2/+1
|/
* Merge pull request #1015 from matoro/masterLars Kanis2023-03-161-1/+1
|\ | | | | Update gen/Rakefile for Ruby 3 compat
| * Update gen/Rakefile for Ruby 3 compatmatoro2023-03-141-1/+1
|/ | | | | | | 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
* Merge pull request #1012 from larskanis/type-check-by-typed-dataLars Kanis2023-03-066-25/+20
|\ | | | | Use type checking by TypedData and remove duplocated check by rb_obj_is_kind_of
| * Use type checking by TypedData and remove duplocated check by rb_obj_is_kind_ofLars Kanis2023-03-066-25/+20
| | | | | | | | This is now possible with new typed data objects.
* | Merge pull request #1013 from larskanis/undef-abstractmem-newLars Kanis2023-03-061-12/+1
|\ \ | | | | | | Remove allocator of AbstractMemory
| * | Remove allocator of AbstractMemoryLars Kanis2023-03-061-12/+1
| |/ | | | | | | | | | | This disables AbstractMemory.new, which has no practical use. As discussed in #1010
* | Merge pull request #1011 from casperisfine/array-type-write-barrierLars Kanis2023-03-063-9/+36
|\ \ | |/ |/| Implement the last missing Write Barriers and dsize
| * Implement the last missing Write Barriers and dsizeJean Boussier2023-03-063-9/+36
|/ | | | | | | | | | | | | | 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.
* Merge pull request #1010 from casperisfine/pointer-write-barrierLars Kanis2023-03-067-17/+104
|\ | | | | Implement Write Barrier and dsize for FFI::Pointer
| * Implement Write Barrier and dsize for FFI::PointerJean Boussier2023-03-067-17/+104
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'struct-layout-write-barrier' of ↵Lars Kanis2023-03-065-16/+70
|\ \ | |/ |/| | | https://github.com/casperisfine/ffi into casperisfine-struct-layout-write-barrier
| * Implement Write Barrier and dsize for FFI::StructLayoutJean Boussier2023-03-065-15/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #1009 from casperisfine/struct-by-value-write-barrierLars Kanis2023-03-061-6/+15
|\ \ | | | | | | Implement Write Barrier and dsize for FFI::StructByValue
| * | Implement Write Barrier and dsize for FFI::StructByValueJean Boussier2023-03-061-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #1008 from casperisfine/variadic-write-barrierLars Kanis2023-03-061-8/+17
|\ \ \ | | | | | | | | Implement Write Barrier and dsize for FFI::VariadicInvoker
| * | | Implement Write Barrier and dsize for FFI::VariadicInvokerJean Boussier2023-03-061-8/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #1007 from casperisfine/struct-write-barrierLars Kanis2023-03-062-29/+63
|\ \ \ | | | | | | | | Implement Write Barrier and dsize for FFI::Struct
| * | | Implement Write Barrier and dsize for FFI::StructJean Boussier2023-03-062-29/+63
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #1005 from casperisfine/type-write-barrierLars Kanis2023-03-065-23/+83
|\ \ \ | |_|/ |/| | Implement Write Barrier and dsize for FFI::Type
| * | Implement Write Barrier and dsize for FFI::TypeJean Boussier2023-03-065-23/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'master' of github.com:ffi/ffiLars Kanis2023-03-062-10/+33
|\ \ \
| * \ \ Merge pull request #1004 from casperisfine/symbol-write-barrierLars Kanis2023-03-062-10/+33
| |\ \ \ | | | | | | | | | | Implement Write Barrier and dsize for FFI::DynamicLibrary
| | * | | Implement Write Barrier and dsize for FFI::DynamicLibraryJean Boussier2023-03-062-10/+33
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge branch 'master' of github.com:ffi/ffiLars Kanis2023-03-062-8/+33
|\ \ \ \ | |/ / /
| * | | Merge pull request #1003 from casperisfine/function-write-barrier-2Lars Kanis2023-03-062-8/+33
| |\ \ \ | | |_|/ | |/| | Implement Write Barrier and dsize for FFI::Function
| | * | Implement Write Barrier and dsize for FFI::FunctionJean Boussier2023-03-062-8/+33
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.