// Returns the number of bytes that are currently in use (referenced by // live JitCode objects).
size_t usedCodeBytes() const {
size_t res = 0; for (size_t count : m_codeBytes) {
res += count;
} return res;
}
};
// alloc() returns a pointer to some memory, and also (by reference) a // pointer to reference-counted pool. The caller owns a reference to the // pool; i.e. alloc() increments the count before returning the object. void* alloc(JSContext* cx, size_t n, ExecutablePool** poolp, CodeKind type);
// On OOM, this will return an Allocation where pages is nullptr.
ExecutablePool::Allocation systemAlloc(size_t n); staticvoid systemRelease(const ExecutablePool::Allocation& alloc);
private: // These are strong references; they keep pools alive. staticconst size_t maxSmallPools = 4;
using SmallExecPoolVector =
js::Vector<ExecutablePool*, maxSmallPools, js::SystemAllocPolicy>;
SmallExecPoolVector m_smallPools;
// All live pools are recorded here, just for stats purposes. These are // weak references; they don't keep pools alive. When a pool is destroyed // its reference is removed from m_pools.
using ExecPoolHashSet =
js::HashSet<ExecutablePool*, js::DefaultHasher<ExecutablePool*>,
js::SystemAllocPolicy>;
ExecPoolHashSet m_pools; // All pools, just for stats purposes.
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.