fixes some strictdefs warnings (#24502)

This commit is contained in:
ringabout
2024-12-04 18:28:13 +08:00
committed by GitHub
parent c3120b6121
commit 8f4bfda5f4
19 changed files with 44 additions and 15 deletions

View File

@@ -575,6 +575,7 @@ proc isAccessible(a: MemRegion, p: pointer): bool {.inline.} =
result = contains(a.chunkStarts, pageIndex(p))
proc contains[T](list, x: T): bool =
result = false
var it = list
while it != nil:
if it == x: return true
@@ -1164,6 +1165,7 @@ proc dealloc(allocator: var MemRegion, p: pointer) =
rawDealloc(allocator, p)
proc realloc(allocator: var MemRegion, p: pointer, newsize: Natural): pointer =
result = nil
if newsize > 0:
result = alloc(allocator, newsize)
if p != nil: