author | Mike Hommey <mh+mozilla@glandium.org> |
Fri, 21 Aug 2015 18:43:10 +0900 | |
changeset 291535 | 187097ffcdc61d8d40510c879ea69253c240573a |
parent 291534 | 3cb2f2b870f4c256dccc8647a2e1e4616c244fda |
child 291536 | c69c21713dc8d97ebfd0de0c6973dfcf44b6216d |
push id | 5245 |
push user | raliiev@mozilla.com |
push date | Thu, 29 Oct 2015 11:30:51 +0000 |
treeherder | mozilla-beta@dac831dc1bd0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | nfroyd |
bugs | 1189967 |
milestone | 43.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
memory/mozalloc/msvc_raise_wrappers.cpp | file | annotate | diff | comparison | revisions | |
memory/mozalloc/msvc_raise_wrappers.h | file | annotate | diff | comparison | revisions |
--- a/memory/mozalloc/msvc_raise_wrappers.cpp +++ b/memory/mozalloc/msvc_raise_wrappers.cpp @@ -4,57 +4,54 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdio.h> #include "mozalloc_abort.h" -#define MOZALLOC_DONT_WRAP_RAISE_FUNCTIONS -#include "mozilla/throw_msvc.h" - __declspec(noreturn) static void abort_from_exception(const char* const which, const char* const what); static void abort_from_exception(const char* const which, const char* const what) { fprintf(stderr, "fatal: STL threw %s: ", which); mozalloc_abort(what); } namespace std { // NB: user code is not supposed to touch the std:: namespace. We're // doing this after careful review because we want to define our own // exception throwing semantics. Don't try this at home! -void +MFBT_API __declspec(noreturn) void moz_Xinvalid_argument(const char* what) { abort_from_exception("invalid_argument", what); } -void +MFBT_API __declspec(noreturn) void moz_Xlength_error(const char* what) { abort_from_exception("length_error", what); } -void +MFBT_API __declspec(noreturn) void moz_Xout_of_range(const char* what) { abort_from_exception("out_of_range", what); } -void +MFBT_API __declspec(noreturn) void moz_Xoverflow_error(const char* what) { abort_from_exception("overflow_error", what); } -void +MFBT_API __declspec(noreturn) void moz_Xruntime_error(const char* what) { abort_from_exception("runtime_error", what); } } // namespace std
--- a/memory/mozalloc/msvc_raise_wrappers.h +++ b/memory/mozalloc/msvc_raise_wrappers.h @@ -12,39 +12,25 @@ # error "Unable to wrap _RAISE(); CRT _RAISE() already defined" #endif #ifdef _XUTILITY_ # error "Unabled to wrap _X[exception]"(); CRT versions already declared" #endif #include "mozilla/mozalloc_abort.h" -namespace std { - -// NB: user code is not supposed to touch the std:: namespace. We're -// doing this after careful review because we want to define our own -// exception throwing semantics. Don't try this at home! - -MFBT_API __declspec(noreturn) void moz_Xinvalid_argument(const char*); -MFBT_API __declspec(noreturn) void moz_Xlength_error(const char*); -MFBT_API __declspec(noreturn) void moz_Xout_of_range(const char*); -MFBT_API __declspec(noreturn) void moz_Xoverflow_error(const char*); -MFBT_API __declspec(noreturn) void moz_Xruntime_error(const char*); - -} // namespace std - -#ifndef MOZALLOC_DONT_WRAP_RAISE_FUNCTIONS - +// xutility will declare the following functions in the std namespace. +// We #define them to be named differently so we can ensure the exception +// throwing semantics of these functions work exactly the way we want, by +// defining our own versions in msvc_raise_wrappers.cpp. # define _Xinvalid_argument moz_Xinvalid_argument # define _Xlength_error moz_Xlength_error # define _Xout_of_range moz_Xout_of_range # define _Xoverflow_error moz_Xoverflow_error # define _Xruntime_error moz_Xruntime_error # include <xstddef> # include <xutility> # undef _RAISE # define _RAISE(x) mozalloc_abort((x).what()) -#endif // ifndef MOZALLOC_DONT_WRAP_RAISE_FUNCTIONS - #endif // ifndef mozilla_msvc_raise_wrappers_h