Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  SkDiscardableMemoryPool.h   Sprache: C

 
/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkDiscardableMemoryPool_DEFINED
#define SkDiscardableMemoryPool_DEFINED

#include "include/private/base/SkMutex.h"
#include "include/private/chromium/SkDiscardableMemory.h"

#ifndef SK_LAZY_CACHE_STATS
    #ifdef SK_DEBUG
        #define SK_LAZY_CACHE_STATS 1
    #else
        #define SK_LAZY_CACHE_STATS 0
    #endif
#endif

/**
 *  An implementation of Discardable Memory that manages a fixed-size
 *  budget of memory.  When the allocated memory exceeds this size,
 *  unlocked blocks of memory are purged.  If all memory is locked, it
 *  can exceed the memory-use budget.
 */

class SkDiscardableMemoryPool : public SkDiscardableMemory::Factory {
public:
    virtual size_t getRAMUsed() = 0;
    virtual void setRAMBudget(size_t budget) = 0;
    virtual size_t getRAMBudget() = 0;

    /** purges all unlocked DMs */
    virtual void dumpPool() = 0;

    #if SK_LAZY_CACHE_STATS
    /**
     * These two values are a count of the number of successful and
     * failed calls to SkDiscardableMemory::lock() for all DMs managed
     * by this pool.
     */

    virtual int getCacheHits() = 0;
    virtual int getCacheMisses() = 0;
    virtual void resetCacheHitsAndMisses() = 0;
    #endif

    /**
     *  This non-global pool can be used for unit tests to verify that
     *  the pool works.
     */

    static sk_sp<SkDiscardableMemoryPool> Make(size_t size);
};

/**
 *  Returns (and creates if needed) a threadsafe global
 *  SkDiscardableMemoryPool.
 */

SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool();

#if !defined(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (128 * 1024 * 1024)
#endif

#endif  // SkDiscardableMemoryPool_DEFINED

Messung V0.5
C=95 H=100 G=97

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge