Various fixes to how the Boehm GC's interface.
The Boehm GC interface did not define the getXXXSharedMem() functions that were needed for compilation with --threads:on. It also used `ppointer` instead of `PPointer`, so it failed to compile with --cs:partial.
This commit is contained in:
parent
63548f04b2
commit
b11493585c
1 changed files with 18 additions and 10 deletions
|
|
@ -131,6 +131,14 @@ when defined(boehmgc):
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc deallocShared(p: pointer) = boehmDealloc(p)
|
proc deallocShared(p: pointer) = boehmDealloc(p)
|
||||||
|
|
||||||
|
when hasThreadSupport:
|
||||||
|
proc getFreeSharedMem(): int =
|
||||||
|
boehmGetFreeBytes()
|
||||||
|
proc getTotalSharedMem(): int =
|
||||||
|
boehmGetHeapSize()
|
||||||
|
proc getOccupiedSharedMem(): int =
|
||||||
|
getTotalSharedMem() - getFreeSharedMem()
|
||||||
|
|
||||||
#boehmGCincremental()
|
#boehmGCincremental()
|
||||||
|
|
||||||
proc GC_disable() = boehmGC_disable()
|
proc GC_disable() = boehmGC_disable()
|
||||||
|
|
@ -164,11 +172,11 @@ when defined(boehmgc):
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRefNoCycle(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -180,7 +188,7 @@ when defined(boehmgc):
|
||||||
proc alloc0(r: var TMemRegion, size: int): pointer =
|
proc alloc0(r: var TMemRegion, size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc dealloc(r: var TMemRegion, p: Pointer) = boehmDealloc(p)
|
proc dealloc(r: var TMemRegion, p: pointer) = boehmDealloc(p)
|
||||||
proc deallocOsPages(r: var TMemRegion) {.inline.} = discard
|
proc deallocOsPages(r: var TMemRegion) {.inline.} = discard
|
||||||
proc deallocOsPages() {.inline.} = discard
|
proc deallocOsPages() {.inline.} = discard
|
||||||
|
|
||||||
|
|
@ -239,11 +247,11 @@ elif defined(nogc) and defined(useMalloc):
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRefNoCycle(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -292,11 +300,11 @@ elif defined(nogc):
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc asgnRefNoCycle(dest: PPointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
||||||
var allocator {.rtlThreadVar.}: TMemRegion
|
var allocator {.rtlThreadVar.}: TMemRegion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue