summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-28 09:29:54 +0200
committerGitHub <noreply@github.com>2018-09-28 09:29:54 +0200
commit07748dba68a2edba4163e8dfbdf7b09251e8cc30 (patch)
tree112eb3b71ca7579e3ebb7e2ae3d113f94daf44aa
parent959e3a08b16cf10f8e0d3a0ebd5bda07aec91327 (diff)
parent907969d69b5a268a75b77db369a7e36608f6736b (diff)
downloadNim-07748dba68a2edba4163e8dfbdf7b09251e8cc30.tar.gz
Merge pull request #9086 from LemonBoy/openssl-mem
Allocate OpenSSL memory outside of the thread heap
-rw-r--r--lib/wrappers/openssl.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index 47fff8397..e1d36e461 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -399,14 +399,14 @@ when not useWinVersion and not defined(macosx) and not defined(android) and not
   proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl,
     dynlib: DLLUtilName, importc.}
 
-  proc allocWrapper(size: int): pointer {.cdecl.} = alloc(size)
+  proc allocWrapper(size: int): pointer {.cdecl.} = allocShared(size)
   proc reallocWrapper(p: pointer; newsize: int): pointer {.cdecl.} =
     if p == nil:
-      if newSize > 0: result = alloc(newsize)
-    elif newsize == 0: dealloc(p)
-    else: result = realloc(p, newsize)
+      if newSize > 0: result = allocShared(newsize)
+    elif newsize == 0: deallocShared(p)
+    else: result = reallocShared(p, newsize)
   proc deallocWrapper(p: pointer) {.cdecl.} =
-    if p != nil: dealloc(p)
+    if p != nil: deallocShared(p)
 
 proc CRYPTO_malloc_init*() =
   when not useWinVersion and not defined(macosx) and not defined(android) and not defined(nimNoAllocForSSL):