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
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;
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);
return result;
}
#endif
+
void *result;
GetLockShared();
result = m_pVMemShared->Malloc(size);
- FreeLockShared()
+ FreeLockShared();
return result;
};
inline void* ReallocShared(void* ptr, size_t size)
void *result;
GetLockShared();
result = m_pVMemShared->Realloc(ptr, size);
- FreeLockShared()
+ FreeLockShared();
return result;
};
inline void FreeShared(void* ptr)
{
GetLockShared();
m_pVMemShared->Free(ptr);
- FreeLockShared()
+ FreeLockShared();
};
inline void* CallocShared(size_t num, size_t size)
{