summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-12-05 22:07:52 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-12-05 22:07:52 +0000
commitce3e5b80724e7725765c5559e5f4b0058876fc19 (patch)
tree5cd0b3ba8df8b83f4ba78db41b101fc3e12d8275
parent0a77e2d7f7c1b1af440a8cf545295905853ca727 (diff)
downloadperl-ce3e5b80724e7725765c5559e5f4b0058876fc19.tar.gz
Win32 PERL_IMPLICIT_SYS passes all tests with USE_PERLIO
- calloc/free suffer from damage on TerminateThread() - use PerlMemShared (as originally planned) now fixed - avoid doing anything important on DLL "detach". p4raw-id: //depot/perlio@8001
-rw-r--r--perl.c10
-rw-r--r--perlio.c6
-rw-r--r--win32/perllib.c9
3 files changed, 14 insertions, 11 deletions
diff --git a/perl.c b/perl.c
index f1cda0e829..1467df1c15 100644
--- a/perl.c
+++ b/perl.c
@@ -786,12 +786,18 @@ perl_free(pTHXx)
#if defined(PERL_OBJECT)
PerlMem_free(this);
#else
-# if defined(PERL_IMPLICIT_SYS) && defined(WIN32)
+# if defined(WIN32)
+# if defined(PERL_IMPLICIT_SYS)
void *host = w32_internal_host;
- if (PerlProc_lasthost())
+ if (PerlProc_lasthost()) {
PerlIO_cleanup();
+ }
PerlMem_free(aTHXx);
win32_delete_internal_host(host);
+#else
+ PerlIO_cleanup();
+ PerlMem_free(aTHXx);
+#endif
# else
PerlMem_free(aTHXx);
# endif
diff --git a/perlio.c b/perlio.c
index d6b3b0841a..cd6a244664 100644
--- a/perlio.c
+++ b/perlio.c
@@ -28,12 +28,6 @@
#define PERL_IN_PERLIO_C
#include "perl.h"
-#undef PerlMemShared_calloc
-#define PerlMemShared_calloc(x,y) calloc(x,y)
-#undef PerlMemShared_free
-#define PerlMemShared_free(x) free(x)
-
-
#ifndef PERLIO_LAYERS
int
PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names)
diff --git a/win32/perllib.c b/win32/perllib.c
index 1a9fa9f438..87b79c031d 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -370,9 +370,12 @@ DllMain(HANDLE hModule, /* DLL module handle */
* process termination or call to FreeLibrary.
*/
case DLL_PROCESS_DETACH:
-#if !defined(PERLIO_IS_STDIO) && !defined(USE_SFIO)
- PerlIO_cleanup();
-#endif
+ /* As long as we use TerminateProcess()/TerminateThread() etc. for mimicing kill()
+ anything here had better be harmless if:
+ A. Not called at all.
+ B. Called after memory allocation for Heap has been forcibly removed by OS.
+ PerlIO_cleanup() was done here but fails (B).
+ */
EndSockets();
#if defined(USE_THREADS) || defined(USE_ITHREADS)
if (PL_curinterp)