* XXX This advice seems to be widely ignored :-( --AD August 1996.
*/
-#ifdef MACOS_TRADITIONAL
-extern void * gSacrificialGoat;
-#define MAC_CHECK_GOAT(p) if (!gSacrificialGoat && p) { PerlMem_free(p); p = NULL; } else
-#endif
-
Malloc_t
Perl_safesysmalloc(MEM_SIZE size)
{
Perl_croak_nocontext("panic: malloc");
#endif
ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
-#ifdef MACOS_TRADITIONAL
- MAC_CHECK_GOAT(ptr);
-#endif
+ PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05d) malloc %ld bytes\n",PTR2UV(ptr),PL_an++,(long)size));
if (ptr != Nullch)
return ptr;
Perl_croak_nocontext("panic: realloc");
#endif
ptr = PerlMem_realloc(where,size);
-
-#ifdef MACOS_TRADITIONAL
- MAC_CHECK_GOAT(ptr);
-#endif
+ PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05d) rfree\n",PTR2UV(where),PL_an++));
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05d) realloc %ld bytes\n",PTR2UV(ptr),PL_an++,(long)size));
#endif
size *= count;
ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
-#ifdef MACOS_TRADITIONAL
- MAC_CHECK_GOAT(ptr);
-#endif
+ PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05d) calloc %ld x %ld bytes\n",PTR2UV(ptr),PL_an++,(long)count,(long)size));
if (ptr != Nullch) {
memset((void*)ptr, 0, size);
SV *sv = mess_alloc();
static char dgd[] = " during global destruction.\n";
-#ifdef MACOS_TRADITIONAL
- sv_setpv(sv, "# ");
- sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
- if (SvPVX(sv)[2] == '#')
- sv_insert(sv, 0, 2, "", 0);
-#else
sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
-#endif
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
dTHR;
if (PL_curcop->cop_line)
Perl_sv_catpvf(aTHX_ sv, " thread %ld", thr->tid);
#endif
sv_catpv(sv, PL_dirty ? dgd : ".\n");
-#ifdef MACOS_TRADITIONAL
- if (PL_curcop->cop_line) {
- MPWPosIndication(sv, SvPVX(GvSV(PL_curcop->cop_filegv)), PL_curcop->cop_line);
- sv_catpv(sv, "\n");
- }
-#endif
}
return sv;
}
errno = e;
#endif
}
-#ifdef MACOS_TRADITIONAL
- MacPosCommit();
-#endif
my_failure_exit();
}