Skip to content

Commit

Permalink
[master] Add init for map node type so as to fix memory errors in ins…
Browse files Browse the repository at this point in the history
…ert.
  • Loading branch information
tomhrr committed Apr 16, 2024
1 parent c7dce17 commit 81ea629
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/map.dt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ must also implement `LessThanComparable`.
(struct extern ((first (uq Tk))
(second (uq Tv)))))

(def init
(fn extern bool ((val (ref (uq pairtypenode))))
(memset (cast val (p void)) 0 (sizeof (uq pairtypenode)))
(init (:@ val first))
(init (:@ val second))))

(def setf-move-init
(fn extern bool ((dst (p (uq pairtypenode)))
(src (rv-ref (uq pairtypenode))))
Expand Down

0 comments on commit 81ea629

Please sign in to comment.