1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "js/AllocationLogging.h"
9 #include "mozilla/Assertions.h" // MOZ_ASSERT
11 static JS::LogCtorDtor sLogCtor
= nullptr;
12 static JS::LogCtorDtor sLogDtor
= nullptr;
14 void JS::SetLogCtorDtorFunctions(LogCtorDtor ctor
, LogCtorDtor dtor
) {
15 MOZ_ASSERT(!sLogCtor
&& !sLogDtor
);
16 MOZ_ASSERT(ctor
&& dtor
);
21 void JS::LogCtor(void* self
, const char* type
, uint32_t sz
) {
22 if (LogCtorDtor fun
= sLogCtor
) {
27 void JS::LogDtor(void* self
, const char* type
, uint32_t sz
) {
28 if (LogCtorDtor fun
= sLogDtor
) {