Bug 1686945 [wpt PR 27199] - Correctly pass --py2 or --py3 to some Azure Pipeline...
[gecko.git] / memory / mozalloc / mozalloc_oom.h
blob7fe93259e804e8f90da2ec6765ada045ed7c0832
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=4 et :
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef mozilla_mozalloc_oom_h
9 #define mozilla_mozalloc_oom_h
11 #include "mozalloc.h"
13 /**
14 * Called when memory is critically low. Returns iff it was able to
15 * remedy the critical memory situation; if not, it will abort().
17 MFBT_API void mozalloc_handle_oom(size_t requestedSize);
19 /**
20 * Called by embedders (specifically Mozilla breakpad) which wants to be
21 * notified of an intentional abort, to annotate any crash report with
22 * the size of the allocation on which we aborted.
24 typedef void (*mozalloc_oom_abort_handler)(size_t size);
25 MFBT_API void mozalloc_set_oom_abort_handler(
26 mozalloc_oom_abort_handler handler);
28 /* TODO: functions to query system memory usage and register
29 * critical-memory handlers. */
31 #endif /* ifndef mozilla_mozalloc_oom_h */