ffi 1.17.0.rc1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ea15fd47a8241bb9bab7086d46ac6bc6ac752c383dc748c616d298f742ed0d0
4
- data.tar.gz: 5253f331c7fea5590f4499133cac83dbeba5d833825339f4fc45cb57f0c94bcd
3
+ metadata.gz: 482fe808cf14286b91be92938712e98f6332021d2773268f96ac583b5c264fc9
4
+ data.tar.gz: f89f881dd5e337ec5ec815e9977158b54ead3a2480bc03fd2591477c7872d29e
5
5
  SHA512:
6
- metadata.gz: e42a6fc177d1302b64a07b6b93a20bf9e0ad4e692a7ab2c16f1f5fbf65ce795fe044187befdcc5859ecb8f3870acac3ca3b687e5e96773f448d0b16e6a1d7710
7
- data.tar.gz: 2efdb5b63defea13f90d5ec7a7f8c7fb85e3cab24fc84320c8e061017946687f0238a68a57375a4ce76aa67f041b6b65966170d4d98d5ed4cac4d1dbd3dc71df
6
+ metadata.gz: 877625d5994e1b456e8cf12a68647ce4e9d64efac2239c7a4e1806406b803fad5c1138ba0ad7e8b34ac6b8ebfeaed9f469381291f394527c523c4db8f36bd976
7
+ data.tar.gz: 8d78610fc0c110ad7d6da40158dab176d815c8008a1276865b9112a44b46e1d43816db7430f9ab991671e4e8fad4dec0880fa259e2e2c83afaf916f59b7bb5c9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
- 1.17.0.rc1 / 2024-04-07
1
+ 1.17.0 / 2024-06-02
2
+ -------------------
3
+
4
+ Fixed:
5
+ * Add FFI::AbstractMemory#read_array_of_string . It was defined but not exposed to Ruby nor tested. #1070
6
+
7
+
8
+ 1.17.0.rc2 / 2024-04-22
9
+ -------------------
10
+
11
+ Fixed:
12
+ * Add missing write barriers to StructLayout#initialize causing a segfault with GC.stress. #1079
13
+
14
+
15
+ 1.17.0.rc1 / 2024-04-08
2
16
  -------------------
3
17
 
4
18
  Fixed:
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
- gem 'bigdecimal' unless RUBY_VERSION =~ /^2\.[4567]|^3\.[012]\./ # necessary on ruby-3.3+
4
+ gem 'bigdecimal' # necessary on ruby-3.3+
5
5
  gem 'bundler', '>= 1.16', '< 3'
6
6
  gem 'rake', '~> 13.0'
7
7
  gem 'rake-compiler', '~> 1.1'
@@ -1109,6 +1109,7 @@ rbffi_AbstractMemory_Init(VALUE moduleFFI)
1109
1109
  rb_define_method(classMemory, "read_bytes", memory_read_bytes, 1);
1110
1110
  rb_define_method(classMemory, "write_bytes", memory_write_bytes, -1);
1111
1111
  rb_define_method(classMemory, "get_array_of_string", memory_get_array_of_string, -1);
1112
+ rb_define_method(classMemory, "read_array_of_string", memory_read_array_of_string, -1);
1112
1113
 
1113
1114
  rb_define_method(classMemory, "get", memory_get, 2);
1114
1115
  rb_define_method(classMemory, "put", memory_put, 3);
@@ -183,7 +183,7 @@ fntype_initialize(int argc, VALUE* argv, VALUE self)
183
183
  Check_Type(rbParamTypes, T_ARRAY);
184
184
 
185
185
  TypedData_Get_Struct(self, FunctionType, &rbffi_fntype_data_type, fnInfo);
186
- fnInfo->parameterCount = (int) RARRAY_LEN(rbParamTypes);
186
+ fnInfo->parameterCount = RARRAY_LENINT(rbParamTypes);
187
187
  fnInfo->parameterTypes = xcalloc(fnInfo->parameterCount, sizeof(*fnInfo->parameterTypes));
188
188
  fnInfo->ffiParameterTypes = xcalloc(fnInfo->parameterCount, sizeof(ffi_type *));
189
189
  fnInfo->nativeParameterTypes = xcalloc(fnInfo->parameterCount, sizeof(*fnInfo->nativeParameterTypes));
@@ -460,9 +460,9 @@ struct_layout_allocate(VALUE klass)
460
460
  VALUE obj;
461
461
 
462
462
  obj = TypedData_Make_Struct(klass, StructLayout, &rbffi_struct_layout_data_type, layout);
463
- layout->rbFieldMap = Qnil;
464
- layout->rbFieldNames = Qnil;
465
- layout->rbFields = Qnil;
463
+ RB_OBJ_WRITE(obj, &layout->rbFieldMap, Qnil);
464
+ RB_OBJ_WRITE(obj, &layout->rbFieldNames, Qnil);
465
+ RB_OBJ_WRITE(obj, &layout->rbFields, Qnil);
466
466
  layout->base.ffiType = xcalloc(1, sizeof(*layout->base.ffiType));
467
467
  layout->base.ffiType->size = 0;
468
468
  layout->base.ffiType->alignment = 0;
@@ -487,14 +487,14 @@ struct_layout_initialize(VALUE self, VALUE fields, VALUE size, VALUE align)
487
487
  int i;
488
488
 
489
489
  TypedData_Get_Struct(self, StructLayout, &rbffi_struct_layout_data_type, layout);
490
- layout->fieldCount = (int) RARRAY_LEN(fields);
491
- layout->rbFieldMap = rb_hash_new();
492
- layout->rbFieldNames = rb_ary_new2(layout->fieldCount);
490
+ layout->fieldCount = RARRAY_LENINT(fields);
491
+ RB_OBJ_WRITE(self, &layout->rbFieldMap, rb_hash_new());
492
+ RB_OBJ_WRITE(self, &layout->rbFieldNames, rb_ary_new2(layout->fieldCount));
493
493
  layout->size = (int) FFI_ALIGN(NUM2INT(size), NUM2INT(align));
494
494
  layout->align = NUM2INT(align);
495
495
  layout->fields = xcalloc(layout->fieldCount, sizeof(StructField *));
496
496
  layout->ffiTypes = xcalloc(layout->fieldCount + 1, sizeof(ffi_type *));
497
- layout->rbFields = rb_ary_new2(layout->fieldCount);
497
+ RB_OBJ_WRITE(self, &layout->rbFields, rb_ary_new2(layout->fieldCount));
498
498
  layout->referenceFieldCount = 0;
499
499
  layout->base.ffiType->elements = layout->ffiTypes;
500
500
  layout->base.ffiType->size = layout->size;
data/ext/ffi_c/Variadic.c CHANGED
@@ -211,7 +211,7 @@ variadic_invoke(VALUE self, VALUE parameterTypes, VALUE parameterValues)
211
211
  Check_Type(parameterValues, T_ARRAY);
212
212
 
213
213
  TypedData_Get_Struct(self, VariadicInvoker, &variadic_data_type, invoker);
214
- paramCount = (int) RARRAY_LEN(parameterTypes);
214
+ paramCount = RARRAY_LENINT(parameterTypes);
215
215
  paramTypes = ALLOCA_N(Type *, paramCount);
216
216
  ffiParamTypes = ALLOCA_N(ffi_type *, paramCount);
217
217
  params = ALLOCA_N(FFIStorage, paramCount);
@@ -31,7 +31,7 @@
31
31
 
32
32
  PROGRAM=libtool
33
33
  PACKAGE=libtool
34
- VERSION="2.4.7 Debian-2.4.7-7"
34
+ VERSION="2.4.7 Debian-2.4.7-7build1"
35
35
  package_revision=2.4.7
36
36
 
37
37
 
@@ -2296,7 +2296,7 @@ include the following information:
2296
2296
  compiler: $LTCC
2297
2297
  compiler flags: $LTCFLAGS
2298
2298
  linker: $LD (gnu? $with_gnu_ld)
2299
- version: $progname $scriptversion Debian-2.4.7-7
2299
+ version: $progname $scriptversion Debian-2.4.7-7build1
2300
2300
  automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2301
2301
  autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2302
2302
 
@@ -45,14 +45,6 @@ module FFI
45
45
  # @note WARNING: passing a proc _may_ cause your pointer to never be
46
46
  # GC'd, unless you're careful to avoid trapping a reference to the
47
47
  # pointer in the proc. See the test specs for examples.
48
- # @overload initialize(pointer) { |p| ... }
49
- # @param pointer [Pointer]
50
- # @yieldparam [Pointer] p +pointer+ passed to the block
51
- # @return [self]
52
- # The passed block will be invoked at GC time.
53
- # @note
54
- # WARNING: passing a block will cause your pointer to never be GC'd.
55
- # This is bad.
56
48
  # @overload initialize(pointer)
57
49
  # @param pointer [Pointer]
58
50
  # @return [self]
@@ -75,7 +67,7 @@ module FFI
75
67
  # The last calling idiom (only one parameter) is generally only
76
68
  # going to be useful if you subclass {AutoPointer}, and override
77
69
  # #release, which by default does nothing.
78
- def initialize(ptr, proc=nil, &block)
70
+ def initialize(ptr, proc=nil)
79
71
  raise TypeError, "Invalid pointer" if ptr.nil? || !ptr.kind_of?(Pointer) ||
80
72
  ptr.kind_of?(MemoryPointer) || ptr.kind_of?(AutoPointer)
81
73
  super(ptr.type_size, ptr)
data/lib/ffi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.17.0.rc1'
2
+ VERSION = '1.17.0'
3
3
  end
@@ -144,6 +144,7 @@ module FFI
144
144
  def read_array_of_float: (Integer length) -> Array[Float]
145
145
  def read_array_of_double: (Integer length) -> Array[Float]
146
146
  def read_array_of_pointer: (Integer length) -> Array[Pointer]
147
+ def read_array_of_string: (?Integer? count) -> Array[String?]
147
148
 
148
149
  def write_array_of_int8: (Array[int] ary) -> self
149
150
  def write_array_of_int16: (Array[int] ary) -> self
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0.rc1
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne Meissner
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain:
11
10
  - |
@@ -33,7 +32,7 @@ cert_chain:
33
32
  5wFER6XhvvLDFAMh/jMg+s7Wd5SbSHgHNSUaUGVtdWkVPOer6oF0aLdZUR3CETkn
34
33
  5nWXZma/BUd3YgYA/Xumc6QQqIS4p7mr
35
34
  -----END CERTIFICATE-----
36
- date: 2024-04-08 00:00:00.000000000 Z
35
+ date: 2024-06-02 00:00:00.000000000 Z
37
36
  dependencies:
38
37
  - !ruby/object:Gem::Dependency
39
38
  name: rake
@@ -749,7 +748,6 @@ metadata:
749
748
  wiki_uri: https://github.com/ffi/ffi/wiki
750
749
  source_code_uri: https://github.com/ffi/ffi/
751
750
  mailing_list_uri: http://groups.google.com/group/ruby-ffi
752
- post_install_message:
753
751
  rdoc_options:
754
752
  - "--exclude=ext/ffi_c/.*\\.o$"
755
753
  - "--exclude=ffi_c\\.(bundle|so)$"
@@ -766,8 +764,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
766
764
  - !ruby/object:Gem::Version
767
765
  version: '0'
768
766
  requirements: []
769
- rubygems_version: 3.5.3
770
- signing_key:
767
+ rubygems_version: 3.6.0.dev
771
768
  specification_version: 4
772
769
  summary: Ruby FFI
773
770
  test_files: []
metadata.gz.sig CHANGED
Binary file