This commit is contained in:
Andreas Rumpf 2020-10-08 17:09:28 +02:00 • committed by GitHub
commit 538a57a522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -321,6 +321,13 @@ proc containsGarbageCollectedRef*(typ: PType): bool =
# things that are garbage-collected)
result = searchTypeFor(typ, isGCRef)
proc isManagedMemory(t: PType): bool =
result = t.kind in GcTypeKinds or
(t.kind == tyProc and t.callConv == ccClosure)
proc containsManagedMemory*(typ: PType): bool =
result = searchTypeFor(typ, isManagedMemory)
proc isTyRef(t: PType): bool =
result = t.kind == tyRef or (t.kind == tyProc and t.callConv == ccClosure)