summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/ioselects/ioselectors_epoll.nim2
-rw-r--r--lib/pure/selectors.nim4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/ioselects/ioselectors_epoll.nim b/lib/pure/ioselects/ioselectors_epoll.nim
index 08cb6ed74..510de8c51 100644
--- a/lib/pure/ioselects/ioselectors_epoll.nim
+++ b/lib/pure/ioselects/ioselectors_epoll.nim
@@ -138,7 +138,7 @@ template checkFd(s, f) =
     var numFD = s.numFD
     while numFD <= f: numFD *= 2
     when hasThreadSupport:
-      s.fds = reallocSharedArray(s.fds, numFD)
+      s.fds = reallocSharedArray(s.fds, s.numFD, numFD)
     else:
       s.fds.setLen(numFD)
     for i in s.numFD ..< numFD:
diff --git a/lib/pure/selectors.nim b/lib/pure/selectors.nim
index fc65e0e9b..2d10e3f32 100644
--- a/lib/pure/selectors.nim
+++ b/lib/pure/selectors.nim
@@ -247,8 +247,8 @@ else:
     proc allocSharedArray[T](nsize: int): ptr SharedArray[T] =
       result = cast[ptr SharedArray[T]](allocShared0(sizeof(T) * nsize))
 
-    proc reallocSharedArray[T](sa: ptr SharedArray[T], nsize: int): ptr SharedArray[T] =
-      result = cast[ptr SharedArray[T]](reallocShared(sa, sizeof(T) * nsize))
+    proc reallocSharedArray[T](sa: ptr SharedArray[T], oldsize, nsize: int): ptr SharedArray[T] =
+      result = cast[ptr SharedArray[T]](reallocShared0(sa, oldsize * sizeof(T), sizeof(T) * nsize))
 
     proc deallocSharedArray[T](sa: ptr SharedArray[T]) =
       deallocShared(cast[pointer](sa))
dreas-desktop> 2010-07-29 21:30:04 +0200 committer Andreas Rumpf <andreas@andreas-desktop> 2010-07-29 21:30:04 +0200 handling of compiler procs improved for DLL generation' href='/ahoang/Nim/commit/lib/nimrtl.nim?h=devel&id=ff02ce2d50d8a4b445f9fba6076527c3db62425c'>ff02ce2d5 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36












                                                                             
               
             





             
            
         
          
   






                                                                  


                                                                          
 
#
#
#            Nimrod's Runtime Library
#        (c) Copyright 2010 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

## Main file to generate a DLL from the standard library. 
## The default Nimrtl does not only contain the ``system`` module, but these 
## too:
##
## * parseutils
## * strutils
## * parseopt
## * parsecfg
## * strtabs
## * times
## * os
## * osproc
## * unicode
## * pegs
## * ropes
## 

when system.appType != "lib":
  {.error: "This file has to be compiled as a library!".}

when not defined(createNimRtl): 
  {.error: "This file has to be compiled with '-d:createNimRtl'".}

import
  parseutils, strutils, parseopt, parsecfg, strtabs, unicode, pegs, ropes,
  os, osproc, times