/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: set ts=8 sts=2 et sw=2 tw=80:
*/ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Automatically allocate and free an Arena for testing purposes. class MOZ_RAII AutoTestArena {
Arena* arena = nullptr;
public: explicit AutoTestArena(JSContext* cx, AllocKind kind, size_t nfree) { // For testing purposes only. Don't do this in real code!
arena = js_pod_calloc<Arena>(1);
MOZ_RELEASE_ASSERT(arena);
// Check again to test restoreFromArenaList restored the original state // (except for the empty arenas which are not restored).
CHECK(ConvertToArenaListOnce(sortedList, expectedBucketCount, nullptr,
expectedFirst, expectedLast));
// Clear the list on exit. new (&sortedList) SortedArenaList(kind);
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 ist noch experimentell.