Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: sw=4 ts=4 et : |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #if defined(XP_WIN) |
michael@0 | 9 | # define MOZALLOC_EXPORT __declspec(dllexport) |
michael@0 | 10 | #endif |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/mozalloc_abort.h" |
michael@0 | 13 | |
michael@0 | 14 | #ifdef ANDROID |
michael@0 | 15 | # include <android/log.h> |
michael@0 | 16 | #endif |
michael@0 | 17 | #include <stdio.h> |
michael@0 | 18 | |
michael@0 | 19 | #include "mozilla/Assertions.h" |
michael@0 | 20 | |
michael@0 | 21 | void |
michael@0 | 22 | mozalloc_abort(const char* const msg) |
michael@0 | 23 | { |
michael@0 | 24 | #ifndef ANDROID |
michael@0 | 25 | fputs(msg, stderr); |
michael@0 | 26 | fputs("\n", stderr); |
michael@0 | 27 | #else |
michael@0 | 28 | __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg); |
michael@0 | 29 | #endif |
michael@0 | 30 | MOZ_CRASH(); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | #if defined(XP_UNIX) |
michael@0 | 34 | // Define abort() here, so that it is used instead of the system abort(). This |
michael@0 | 35 | // lets us control the behavior when aborting, in order to get better results |
michael@0 | 36 | // on *NIX platforms. See mozalloc_abort for details. |
michael@0 | 37 | void abort(void) |
michael@0 | 38 | { |
michael@0 | 39 | mozalloc_abort("Redirecting call to abort() to mozalloc_abort\n"); |
michael@0 | 40 | } |
michael@0 | 41 | #endif |
michael@0 | 42 |