Changeset 669


Ignore:
Timestamp:
Sep 9, 2003, 11:50:03 AM (22 years ago)
Author:
bird
Message:

* empty log message *

Location:
trunk/src/emx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/emx/umalloc.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r668 r669  
    760760
    761761
     762static __inline__ void _um_abort (const char *pszmsg)
     763{
     764  /* Use the 'syscall' write for safest possible path. */
     765  extern int __write (int handle, const void *buf, size_t nbytes);
     766  __write (2, "\r\n!_um_abort!", 13);
     767  if (pszmsg)
     768    {
     769      const char *psz = pszmsg;
     770      while (*psz)
     771        psz++;
     772      __write (2, pszmsg, psz - pszmsg);
     773    }
     774  __write (2, "\r\n", 2);
     775  __asm__ __volatile__ ("int $3");
     776}
     777
     778
    762779#if defined (__cplusplus)
    763780}
  • trunk/src/emx/src/lib/malloc/ifree.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r668 r669  
    4040      break;
    4141  if (*patch == NULL)
    42     abort ();
     42    {
     43      _um_abort ("Corrupt heap? (Patch not found.)");
     44      return;
     45    }
    4346  *patch = crate->next;
    4447
     
    123126  hdr = _HDR_FROM_BLOCK (block);
    124127  if (_UM_HDR_STATUS (hdr) == _UMS_FREE)
    125     abort ();
     128    {
     129      _um_abort ("Tried to free block twice! (free)");
     130      return;
     131    }
    126132  parent = _PTR_FROM_UMINT (hdr->parent, _umagic);
    127133  switch (*parent)
     
    136142      break;
    137143    default:
    138       abort ();
     144      _um_abort ("Corrupt heap or passing wrong pointer to free! (bad parent magic)");
     145      return;
     146
    139147    }
    140148}
  • trunk/src/emx/src/lib/malloc/irealloc.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r668 r669  
    309309  hdr = _HDR_FROM_BLOCK (block);
    310310  if (_UM_HDR_STATUS (hdr) == _UMS_FREE)
    311     abort ();
     311    {
     312      _um_abort ("Tried to free block twice! (realloc)");
     313      return NULL;
     314    }
    312315  parent = _PTR_FROM_UMINT (hdr->parent, _umagic);
    313316  switch (*parent)
     
    323326                               align, flags);
    324327    default:
    325       abort ();
    326     }
    327 }
     328      {
     329        _um_abort ("Corrupt heap or passing wrong pointer to realloc! (bad parent magic)");
     330        return NULL;
     331      }
     332    }
     333}
Note: See TracChangeset for help on using the changeset viewer.