Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/base/crashtests/   (Linux Kernel Version 6.17.9©)  Datei vom 27.6.2026 mit Größe 196 B image not shown  

Impressum nsPresArena.h   Sprache: C

 

/* 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/.
 */


/* arena allocation for the frame tree and closely-related objects */

#ifndef nsPresArena_h_
#define nsPresArena_h_

#include "mozilla/ArenaAllocator.h"
#include "mozilla/ArenaObjectID.h"
#include "mozilla/MemoryChecking.h"  // Note: Do not remove this, needed for MOZ_HAVE_MEM_CHECKS below
#include "mozilla/MemoryReporting.h"
#include "nsHashKeys.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "nscore.h"

class nsWindowSizes;

template <size_t ArenaSize, typename ObjectId, size_t ObjectIdCount>
class nsPresArena {
 public:
  nsPresArena() = default;
  ~nsPresArena();

  /**
   * Pool allocation with recycler lists indexed by object-type ID (see above).
   * Every aID must always be used with the same object size, aSize.
   */

  void* Allocate(ObjectId aCode, size_t aSize);
  void Free(ObjectId aCode, void* aPtr);

  enum class ArenaKind { PresShell, DisplayList };
  /**
   * Increment nsWindowSizes with sizes of interesting objects allocated in this
   * arena, and put the general unclassified size in the relevant field
   * depending on the arena size.
   */

  void AddSizeOfExcludingThis(nsWindowSizes&, ArenaKind) const;

  void Check() { mPool.Check(); }

 private:
  class FreeList {
   public:
    nsTArray<void*> mEntries;
    size_t mEntrySize;
    size_t mEntriesEverAllocated;

    FreeList() : mEntrySize(0), mEntriesEverAllocated(0) {}

    size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
      return mEntries.ShallowSizeOfExcludingThis(aMallocSizeOf);
    }
  };

  FreeList mFreeLists[ObjectIdCount];
  mozilla::ArenaAllocator<ArenaSize, 8> mPool;
};

#endif

Messung V0.5 in Prozent
C=91 H=100 G=95

¤ 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.0.9Bemerkung:  (vorverarbeitet am  2026-09-29) ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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:

sprechenden Kalenders