Incremental Mac integration from Matthias.
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index cc09a64..22a287f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -78,11 +78,6 @@ long lastxycount[MAXXCOUNT][MAXYCOUNT];
  * 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)
 {
@@ -100,9 +95,7 @@ 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;
@@ -146,10 +139,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
        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));
@@ -200,9 +190,7 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE 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);
@@ -1428,14 +1416,7 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
     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)
@@ -1454,12 +1435,6 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
            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;
 }
@@ -1629,9 +1604,6 @@ Perl_vcroak(pTHX_ const char* pat, va_list *args)
        errno = e;
 #endif
     }
-#ifdef MACOS_TRADITIONAL
-    MacPosCommit();
-#endif
     my_failure_exit();
 }