diff options
Diffstat (limited to 'lib/system')
-rw-r--r-- | lib/system/cgprocs.nim | 8 | ||||
-rw-r--r-- | lib/system/chcks.nim | 2 | ||||
-rw-r--r-- | lib/system/dyncalls.nim | 2 | ||||
-rw-r--r-- | lib/system/excpt.nim | 4 | ||||
-rw-r--r-- | lib/system/gc_common.nim | 8 | ||||
-rw-r--r-- | lib/system/memory.nim | 6 | ||||
-rw-r--r-- | lib/system/sysstr.nim | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/lib/system/cgprocs.nim b/lib/system/cgprocs.nim index 72219c2b7..9d0d248c3 100644 --- a/lib/system/cgprocs.nim +++ b/lib/system/cgprocs.nim @@ -13,8 +13,8 @@ type LibHandle = pointer # private type ProcAddr = pointer # library loading and loading of procs: -proc nimLoadLibrary(path: string): LibHandle {.compilerproc.} -proc nimUnloadLibrary(lib: LibHandle) {.compilerproc.} -proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr {.compilerproc.} +proc nimLoadLibrary(path: string): LibHandle {.compilerproc, hcrInline, nonReloadable.} +proc nimUnloadLibrary(lib: LibHandle) {.compilerproc, hcrInline, nonReloadable.} +proc nimGetProcAddr(lib: LibHandle, name: cstring): ProcAddr {.compilerproc, hcrInline, nonReloadable.} -proc nimLoadLibraryError(path: string) {.compilerproc, noinline.} +proc nimLoadLibraryError(path: string) {.compilerproc, hcrInline, nonReloadable.} diff --git a/lib/system/chcks.nim b/lib/system/chcks.nim index 0840d863a..789d709f7 100644 --- a/lib/system/chcks.nim +++ b/lib/system/chcks.nim @@ -8,7 +8,7 @@ # # Implementation of some runtime checks. -import system/indexerrors +include system/indexerrors proc raiseRangeError(val: BiggestInt) {.compilerproc, noinline.} = when hostOS == "standalone": diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim index 528587d05..74bdd5372 100644 --- a/lib/system/dyncalls.nim +++ b/lib/system/dyncalls.nim @@ -33,7 +33,7 @@ proc nimLoadLibraryError(path: string) = discard MessageBoxA(0, msg[0].addr, nil, 0) quit(1) -proc procAddrError(name: cstring) {.noinline.} = +proc procAddrError(name: cstring) {.compilerproc, nonReloadable, hcrInline.} = # carefully written to avoid memory allocation: cstderr.rawWrite("could not import: ") cstderr.rawWrite(name) diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 93fd693e0..cb2cda214 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -20,9 +20,9 @@ var proc c_fwrite(buf: pointer, size, n: csize, f: CFilePtr): cint {. importc: "fwrite", header: "<stdio.h>".} -proc rawWrite(f: CFilePtr, s: string|cstring) = +proc rawWrite(f: CFilePtr, s: cstring) {.compilerproc, nonreloadable, hcrInline.} = # we cannot throw an exception here! - discard c_fwrite(cstring(s), 1, s.len, f) + discard c_fwrite(s, 1, s.len, f) when not defined(windows) or not defined(guiapp): proc writeToStdErr(msg: cstring) = rawWrite(cstderr, msg) diff --git a/lib/system/gc_common.nim b/lib/system/gc_common.nim index 5af64ae20..91c0244ea 100644 --- a/lib/system/gc_common.nim +++ b/lib/system/gc_common.nim @@ -446,10 +446,10 @@ proc deallocHeap*(runFinalizers = true; allowGcAfterwards = true) = type GlobalMarkerProc = proc () {.nimcall, benign.} var - globalMarkersLen: int - globalMarkers: array[0..3499, GlobalMarkerProc] - threadLocalMarkersLen: int - threadLocalMarkers: array[0..3499, GlobalMarkerProc] + globalMarkersLen {.exportc.}: int + globalMarkers {.exportc.}: array[0..3499, GlobalMarkerProc] + threadLocalMarkersLen {.exportc.}: int + threadLocalMarkers {.exportc.}: array[0..3499, GlobalMarkerProc] gHeapidGenerator: int proc nimRegisterGlobalMarker(markerProc: GlobalMarkerProc) {.compilerProc.} = diff --git a/lib/system/memory.nim b/lib/system/memory.nim index f86fd4696..318dffa2d 100644 --- a/lib/system/memory.nim +++ b/lib/system/memory.nim @@ -11,7 +11,7 @@ proc nimCopyMem(dest, source: pointer, size: Natural) {.compilerproc, inline.} = d[i] = s[i] inc i -proc nimSetMem(a: pointer, v: cint, size: Natural) {.inline.} = +proc nimSetMem(a: pointer, v: cint, size: Natural) {.nonReloadable, inline.} = when useLibC: c_memset(a, v, size) else: @@ -22,7 +22,7 @@ proc nimSetMem(a: pointer, v: cint, size: Natural) {.inline.} = a[i] = v inc i -proc nimZeroMem(p: pointer, size: Natural) {.compilerproc, inline.} = +proc nimZeroMem(p: pointer, size: Natural) {.compilerproc, nonReloadable, inline.} = nimSetMem(p, 0, size) proc nimCmpMem(a, b: pointer, size: Natural): cint {.compilerproc, inline.} = @@ -37,7 +37,7 @@ proc nimCmpMem(a, b: pointer, size: Natural): cint {.compilerproc, inline.} = if d != 0: return d inc i -proc nimCStrLen(a: cstring): csize {.compilerproc, inline.} = +proc nimCStrLen(a: cstring): csize {.compilerproc, nonReloadable, inline.} = when useLibC: c_strlen(a) else: diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index 33cd4415f..9ba432459 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -82,7 +82,7 @@ proc copyStr(s: NimString, start: int): NimString {.compilerProc.} = if s == nil: return nil result = copyStrLast(s, start, s.len-1) -proc nimToCStringConv(s: NimString): cstring {.compilerProc, inline.} = +proc nimToCStringConv(s: NimString): cstring {.compilerProc, nonReloadable, inline.} = if s == nil or s.len == 0: result = cstring"" else: result = cstring(addr s.data) |