コード例 #1
0
void sk_abort_no_print() {
#ifdef SK_DEBUG
    const char* env = PR_GetEnv("MOZ_SKIA_DISABLE_ASSERTS");
    if (env && *env != '0') {
        return;
    }
#endif
    mozalloc_abort("Abort from sk_abort");
}
コード例 #2
0
// Define abort() here, so that it is used instead of the system abort(). This
// lets us control the behavior when aborting, in order to get better results
// on *NIX platforms. See mozalloc_abort for details.
void abort(void)
{
#ifdef MOZ_WIDGET_ANDROID
    char msg[64] = {};
    fillAbortMessage(msg, uintptr_t(__builtin_return_address(0)));
#else
    const char* const msg = "Redirecting call to abort() to mozalloc_abort\n";
#endif

    mozalloc_abort(msg);
}
コード例 #3
0
void
mozalloc_handle_oom(size_t size)
{
    char oomMsg[] = OOM_MSG_LEADER OOM_MSG_DIGITS OOM_MSG_TRAILER;
    int i;

    // NB: this is handle_oom() stage 1, which simply aborts on OOM.
    // we might proceed to a stage 2 in which an attempt is made to
    // reclaim memory

    if (gAbortHandler)
        gAbortHandler(size);

    // Insert size into the diagnostic message using only primitive operations
    for (i = OOM_MSG_LAST_DIGIT_OFFSET;
         size && i >= OOM_MSG_FIRST_DIGIT_OFFSET; i--) {
      oomMsg[i] = hex[size % 16];
      size /= 16;
    }

    mozalloc_abort(oomMsg);
}
コード例 #4
0
ファイル: mozalloc_abort.cpp プロジェクト: dryeo/Pale-Moon
// Define abort() here, so that it is used instead of the system abort(). This
// lets us control the behavior when aborting, in order to get better results
// on *NIX platforms. See mozalloc_abort for details.
void abort(void)
{
    mozalloc_abort("Redirecting call to abort() to mozalloc_abort\n");
}
コード例 #5
0
void
mozilla_Throw(const exception& e)
{
    mozalloc_abort(e.what());
}
コード例 #6
0
static void
abort_from_exception(const char* const which,  const char* const what)
{
    fprintf(stderr, "fatal: STL threw %s: ", which);
    mozalloc_abort(what);
}