--- IO-AIO/AIO.xs 2011/07/17 04:20:04 1.188 +++ IO-AIO/AIO.xs 2011/07/18 01:27:03 1.189 @@ -32,11 +32,10 @@ #ifdef _WIN32 - #define EIO_STRUCT_DIRENT Direntry_t + // perl overrides all those nice libc functions + #undef malloc #undef free - - // perl overrides all those nice libc functions #undef open #undef read #undef write @@ -712,9 +711,13 @@ } } -static void atfork_child (void) +static void ecb_cold +atfork_child (void) { create_respipe (); + + if (eio_init (want_poll, done_poll) < 0) + croak ("IO::AIO: unable to initialise eio library"); } /*****************************************************************************/ @@ -922,13 +925,8 @@ newCONSTSUB (aio_stash, "PAGESIZE", newSViv (PAGESIZE)); - create_respipe (); - - if (eio_init (want_poll, done_poll) < 0) - croak ("IO::AIO: unable to initialise eio library"); - - /* atfork child called in fifo order, so before eio's handler */ X_THREAD_ATFORK (0, 0, atfork_child); + atfork_child (); /* calls create_respipe and eio_init */ } void