tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

wrappers.cpp (1112B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 // This ensures the right configuration for e.g. MOZ_GLUE_IN_PROGRAM,
      7 // used in the MFBT headers included further below. We use js-confdefs.h
      8 // instead of mozilla-config.h because the latter is not present in
      9 // spidermonkey standalone builds while the former is always present.
     10 #include "js-confdefs.h"
     11 #include "mozilla/Assertions.h"
     12 #include "mozilla/Types.h"
     13 #include "mozilla/mozalloc_oom.h"
     14 
     15 // MOZ_Crash wrapper for use by rust, since MOZ_Crash is an inline function.
     16 extern "C" void RustMozCrash(const char* aFilename, int aLine,
     17                             const char* aReason) {
     18  MOZ_Crash(aFilename, aLine, aReason);
     19 }
     20 
     21 // mozalloc_handle_oom wrapper for use by rust, because mozalloc_handle_oom is
     22 // MFBT_API, that rust can't respect.
     23 extern "C" void RustHandleOOM(size_t size) { mozalloc_handle_oom(size); }