Skip to content

Commit

Permalink
WeakRef: use instance_sizeof in allocate
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Apr 7, 2017
1 parent 4ba262d commit 2229513
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/weak_ref.cr
Expand Up @@ -9,7 +9,7 @@ class WeakRef(T)
end

def self.allocate
ptr = GC.malloc_atomic(sizeof(self)).as(self)
ptr = GC.malloc_atomic(instance_sizeof(self)).as(self)
set_crystal_type_id(ptr)
ptr
end
Expand Down

0 comments on commit 2229513

Please sign in to comment.