summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-10-20 22:23:53 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-10-20 22:23:53 +0000
commit7fcdafbdb0bffcc321d3a9c54e5d13442d621313 (patch)
treeb090db0be4d2e3c23bfdac7ced7a0053cd6bb985 /perlio.c
parent5ed1ec7bdfae87aa5419ee42de2a3f5267b16906 (diff)
downloadperl-7fcdafbdb0bffcc321d3a9c54e5d13442d621313.tar.gz
Fix typos in new locking on MemShared
Make buffers in PerlIOBuf_* in per-thread heap (they are cloned after all...) - seems to make segfaults more deterministic - suspect they are attempt to free() after Interp and Host have gone. p4raw-id: //depot/perlio@12541
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index c33045cbb9..f1cddb375b 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3058,7 +3058,7 @@ PerlIOBuf_close(PerlIO *f)
IV code = PerlIOBase_close(f);
PerlIOBuf *b = PerlIOSelf(f, PerlIOBuf);
if (b->buf && b->buf != (STDCHAR *) & b->oneword) {
- PerlMemShared_free(b->buf);
+ safefree(b->buf);
}
b->buf = NULL;
b->ptr = b->end = b->buf;
@@ -3093,7 +3093,8 @@ PerlIOBuf_get_base(PerlIO *f)
if (!b->buf) {
if (!b->bufsiz)
b->bufsiz = 4096;
- b->buf = PerlMemShared_calloc(b->bufsiz, sizeof(STDCHAR));
+ b->buf =
+ Newz('B',b->buf,b->bufsiz, STDCHAR);
if (!b->buf) {
b->buf = (STDCHAR *) & b->oneword;
b->bufsiz = sizeof(b->oneword);
@@ -4222,3 +4223,4 @@ PerlIO_sprintf(char *s, int n, const char *fmt, ...)
return result;
}
#endif
+