mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
fixes #11447
This commit is contained in:
@@ -235,6 +235,8 @@ elif defined(gogc):
|
||||
proc goSetFinalizer(obj: pointer, f: pointer) {.importc: "set_finalizer", codegenDecl:"$1 $2$3 __asm__ (\"main.Set_finalizer\");\n$1 $2$3", dynlib: goLib.}
|
||||
proc writebarrierptr(dest: PPointer, src: pointer) {.importc: "writebarrierptr", codegenDecl:"$1 $2$3 __asm__ (\"main.Atomic_store_pointer\");\n$1 $2$3", dynlib: goLib.}
|
||||
|
||||
proc `$`*(x: uint64): string {.noSideEffect, raises: [].}
|
||||
|
||||
proc GC_getStatistics(): string =
|
||||
var mstats = goMemStats()
|
||||
result = "[GC] total allocated memory: " & $(mstats.total_alloc) & "\n" &
|
||||
@@ -268,7 +270,7 @@ elif defined(gogc):
|
||||
result = goMalloc(size.uint)
|
||||
|
||||
proc realloc(p: pointer, newsize: Natural): pointer =
|
||||
raise newException(Exception, "not implemented")
|
||||
doAssert false, "not implemented"
|
||||
|
||||
proc dealloc(p: pointer) =
|
||||
discard
|
||||
|
||||
@@ -304,7 +304,7 @@ proc nimCharToStr(x: char): string {.compilerRtl.} =
|
||||
result = newString(1)
|
||||
result[0] = x
|
||||
|
||||
proc `$`*(x: uint64): string {.noSideEffect.} =
|
||||
proc `$`*(x: uint64): string {.noSideEffect, raises: [].} =
|
||||
## The stringify operator for an unsigned integer argument. Returns `x`
|
||||
## converted to a decimal string.
|
||||
if x == 0:
|
||||
|
||||
7
tests/system/tgogc.nim
Normal file
7
tests/system/tgogc.nim
Normal file
@@ -0,0 +1,7 @@
|
||||
discard """
|
||||
disabled: "windows"
|
||||
cmd: "nim c --gc:go $file"
|
||||
action: "compile"
|
||||
"""
|
||||
# bug #11447
|
||||
echo "Go GC test"
|
||||
Reference in New Issue
Block a user