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 #ifndef gc_GCContext_inl_h
8 #define gc_GCContext_inl_h
10 #include "gc/GCContext.h"
12 #include "gc/ZoneAllocator.h"
14 inline void JS::GCContext::free_(Cell
* cell
, void* p
, size_t nbytes
,
17 removeCellMemory(cell
, nbytes
, use
);
23 inline void JS::GCContext::release(Cell
* cell
, T
* p
, size_t nbytes
,
26 removeCellMemory(cell
, nbytes
, use
);
31 inline void JS::GCContext::removeCellMemory(Cell
* cell
, size_t nbytes
,
33 // This may or may not be called as part of GC.
34 if (nbytes
&& cell
->isTenured()) {
35 auto zone
= js::ZoneAllocator::from(cell
->asTenured().zoneFromAnyThread());
36 zone
->removeCellMemory(cell
, nbytes
, use
, isFinalizing());
40 #endif // gc_GCContext_inl_h