summary refs log tree commit diff stats
path: root/lib/system/memory.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/memory.nim')
-rw-r--r--lib/system/memory.nim8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/system/memory.nim b/lib/system/memory.nim
index 8d190e5f9..156773c48 100644
--- a/lib/system/memory.nim
+++ b/lib/system/memory.nim
@@ -2,9 +2,6 @@
 
 const useLibC = not defined(nimNoLibc)
 
-when not defined(nimHasHotCodeReloading):
-  {.pragma: nonReloadable.}
-
 when useLibC:
   import ansi_c
 
@@ -45,9 +42,10 @@ proc nimCmpMem*(a, b: pointer, size: Natural): cint {.compilerproc, nonReloadabl
       if d != 0: return d
       inc i
 
-proc nimCStrLen*(a: cstring): csize_t {.compilerproc, nonReloadable, inline.} =
+proc nimCStrLen*(a: cstring): int {.compilerproc, nonReloadable, inline.} =
+  if a.isNil: return 0
   when useLibC:
-    c_strlen(a)
+    cast[int](c_strlen(a))
   else:
     var a = cast[ptr byte](a)
     while a[] != 0: