builtin: do not call C.GC_FREE with -gc boehm

pull/9468/head
Delyan Angelov 2021-03-25 09:15:01 +02:00
parent b0878d3a92
commit 03d56865e3
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 1 deletions

View File

@ -315,7 +315,9 @@ pub fn free(ptr voidptr) {
return return
} }
$if gcboehm ? { $if gcboehm ? {
C.GC_FREE(ptr) // It is better to leave it to Boehm's gc to free things.
// Calling C.GC_FREE(ptr) was tried initially, but does not work
// well with programs that do manual management themselves.
return return
} }
C.free(ptr) C.free(ptr)