@@ -88,25 +88,27 @@ let check_alloc_fields = function
88
88
let make_block ~dbg kind alloc_mode args =
89
89
check_alloc_fields args;
90
90
let mode = Alloc_mode.For_allocations. to_lambda alloc_mode in
91
- match (kind : P.Block_kind.t ) with
92
- | Values (tag , _ ) -> C. make_alloc ~mode dbg (Tag.Scannable. to_int tag) args
93
- | Naked_floats ->
94
- C. make_float_alloc ~mode dbg (Tag. to_int Tag. double_array_tag) args
95
- | Mixed (tag , shape ) ->
96
- let value_prefix_size = K.Mixed_block_shape. value_prefix_size shape in
97
- let flat_suffix =
98
- Array. map
99
- (fun (flat_elt : K.Flat_suffix_element.t ) : C.Flat_suffix_element. t ->
100
- match flat_elt with
101
- | Tagged_immediate -> Tagged_immediate
102
- | Naked_float -> Naked_float
103
- | Naked_float32 -> Naked_float32
104
- | Naked_int32 -> Naked_int32
105
- | Naked_int64 | Naked_nativeint -> Naked_int64_or_nativeint )
106
- (K.Mixed_block_shape. flat_suffix shape)
107
- in
108
- C. make_mixed_alloc ~mode dbg ~tag: (Tag.Scannable. to_int tag)
109
- ~value_prefix_size ~flat_suffix args
91
+ let allocator, tag =
92
+ match (kind : P.Block_kind.t ) with
93
+ | Values (tag , _ ) -> C. make_alloc, Tag.Scannable. to_tag tag
94
+ | Naked_floats -> C. make_float_alloc, Tag. double_array_tag
95
+ | Mixed (tag , shape ) ->
96
+ let value_prefix_size = K.Mixed_block_shape. value_prefix_size shape in
97
+ let flat_suffix =
98
+ Array. map
99
+ (fun (flat_elt : K.Flat_suffix_element.t ) : C.Flat_suffix_element. t ->
100
+ match flat_elt with
101
+ | Tagged_immediate -> Tagged_immediate
102
+ | Naked_float -> Naked_float
103
+ | Naked_float32 -> Naked_float32
104
+ | Naked_int32 -> Naked_int32
105
+ | Naked_int64 | Naked_nativeint -> Naked_int64_or_nativeint )
106
+ (K.Mixed_block_shape. flat_suffix shape)
107
+ in
108
+ ( C. make_mixed_alloc ~value_prefix_size ~flat_suffix ,
109
+ Tag.Scannable. to_tag tag )
110
+ in
111
+ allocator ~mode dbg ~tag: (Tag. to_int tag) args
110
112
111
113
let block_load ~dbg (kind : P.Block_access_kind.t ) (mutability : Mutability.t )
112
114
~block ~index =
@@ -159,9 +161,9 @@ let make_array ~dbg kind alloc_mode args =
159
161
check_alloc_fields args;
160
162
let mode = Alloc_mode.For_allocations. to_lambda alloc_mode in
161
163
match (kind : P.Array_kind.t ) with
162
- | Immediates | Values -> C. make_alloc ~mode dbg 0 args
164
+ | Immediates | Values -> C. make_alloc ~mode dbg ~tag: 0 args
163
165
| Naked_floats ->
164
- C. make_float_alloc ~mode dbg (Tag. to_int Tag. double_array_tag) args
166
+ C. make_float_alloc ~mode dbg ~tag: (Tag. to_int Tag. double_array_tag) args
165
167
| Naked_float32s -> C. allocate_unboxed_float32_array ~elements: args mode dbg
166
168
| Naked_int32s -> C. allocate_unboxed_int32_array ~elements: args mode dbg
167
169
| Naked_int64s -> C. allocate_unboxed_int64_array ~elements: args mode dbg
0 commit comments