From 81376fef7ffa661569c0b3421c0cc8a282446d2b Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Wed, 18 Jun 2025 11:39:36 +0200 Subject: [PATCH] chore: potential fix and logs --- library/alloc.nim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/alloc.nim b/library/alloc.nim index b185dd7..b2cf1f1 100644 --- a/library/alloc.nim +++ b/library/alloc.nim @@ -30,15 +30,22 @@ proc allocSharedSeq*[T](s: seq[T]): SharedSeq[T] = return (cast[ptr UncheckedArray[T]](data), s.len) proc deallocSharedSeq*[T](s: var SharedSeq[T]) = + echo "------------ deallocSharedSeq 1" if not s.data.isNil: + echo "------------ deallocSharedSeq 2" when T is cstring: + echo "------------ deallocSharedSeq 3" # For array of cstrings, deallocate each string first for i in 0 ..< s.len: + echo "------------ deallocSharedSeq 4" if not s.data[i].isNil: + echo "------------ deallocSharedSeq 5" # Deallocate each cstring deallocShared(s.data[i]) - deallocShared(s.data) + echo "------------ deallocSharedSeq 6" + deallocShared(s.data) + echo "------------ deallocSharedSeq 7" s.len = 0 proc toSeq*[T](s: SharedSeq[T]): seq[T] =