memory/mozalloc/mozalloc_abort.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/memory/mozalloc/mozalloc_abort.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * vim: sw=4 ts=4 et :
     1.6 + */
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifndef mozilla_mozalloc_abort_h
    1.12 +#define mozilla_mozalloc_abort_h
    1.13 +
    1.14 +#include "mozilla/Attributes.h"
    1.15 +
    1.16 +#if defined(MOZALLOC_EXPORT)
    1.17 +// do nothing: it's been defined to __declspec(dllexport) by
    1.18 +// mozalloc*.cpp on platforms where that's required
    1.19 +#elif defined(XP_WIN)
    1.20 +#  define MOZALLOC_EXPORT __declspec(dllimport)
    1.21 +#elif defined(HAVE_VISIBILITY_ATTRIBUTE)
    1.22 +/* Make sure symbols are still exported even if we're wrapped in a
    1.23 + * |visibility push(hidden)| blanket. */
    1.24 +#  define MOZALLOC_EXPORT __attribute__ ((visibility ("default")))
    1.25 +#else
    1.26 +#  define MOZALLOC_EXPORT
    1.27 +#endif
    1.28 +
    1.29 +/**
    1.30 + * Terminate this process in such a way that breakpad is triggered, if
    1.31 + * at all possible.
    1.32 + *
    1.33 + * Note: MOZ_NORETURN seems to break crash stacks on ARM, so we don't
    1.34 + * use that annotation there.
    1.35 + */
    1.36 +MOZALLOC_EXPORT
    1.37 +#if !defined(__arm__)
    1.38 +  MOZ_NORETURN
    1.39 +#endif
    1.40 +  void mozalloc_abort(const char* const msg);
    1.41 +
    1.42 +
    1.43 +#endif  /* ifndef mozilla_mozalloc_abort_h */

mercurial