Skip to content

Commit

Permalink
Use Obj.obj rather than Obj.magic where appropriate
Browse files Browse the repository at this point in the history
Both are currently `"%identity"`, but the `Obj` API distinguishes between the
two.
  • Loading branch information
polytypic committed Apr 18, 2024
1 parent a97296b commit a78611a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/padding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ let copy_as_padded (o : 'a) : 'a =
let t = Obj.tag o in
if Sys.word_size = 64 && t != Obj.double_array_tag then begin
let n = Obj.new_block t padded_size in
Array.blit (Obj.magic o) 0 (Obj.magic n) 0 original_size;
Obj.magic n
Array.blit (Obj.obj o) 0 (Obj.obj n) 0 original_size;
Obj.obj n
end
else Obj.magic o
else Obj.obj o
end
else Obj.magic o
else Obj.obj o
end
else Obj.magic o
else Obj.obj o

let make_padded_array n x =
let a = Array.make (n + num_padding_words) x in
Expand Down

0 comments on commit a78611a

Please sign in to comment.