diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-04-18 16:23:32 +0200 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-04-18 16:23:32 +0200 |
commit | bc48722cee0d5dc9982aed633981b8a8b4885880 (patch) | |
tree | e8e3d53050467510d2a5b7da7327f42a0ec535dd | |
parent | 1689cc0fa2eba174ec66bffa5d8f1656760c6702 (diff) | |
download | ffi-bc48722cee0d5dc9982aed633981b8a8b4885880.tar.gz |
Freeze constant in StructLayoutBuilder
since there's no need to modify it later on
-rw-r--r-- | lib/ffi/struct_layout_builder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ffi/struct_layout_builder.rb b/lib/ffi/struct_layout_builder.rb index 4d6a464..5488033 100644 --- a/lib/ffi/struct_layout_builder.rb +++ b/lib/ffi/struct_layout_builder.rb @@ -97,7 +97,7 @@ module FFI # List of number types - NUMBER_TYPES = [ + NUMBER_TYPES = FFI.make_shareable([ Type::INT8, Type::UINT8, Type::INT16, @@ -112,7 +112,7 @@ module FFI Type::FLOAT64, Type::LONGDOUBLE, Type::BOOL, - ] + ]) # @param [String, Symbol] name name of the field # @param [Array, DataConverter, Struct, StructLayout::Field, Symbol, Type] type type of the field |