From bc48722cee0d5dc9982aed633981b8a8b4885880 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Tue, 18 Apr 2023 16:23:32 +0200 Subject: Freeze constant in StructLayoutBuilder since there's no need to modify it later on --- lib/ffi/struct_layout_builder.rb | 4 ++-- 1 file 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 -- cgit v1.2.1