Mercurial > hg > svcore
diff base/StorageAdviser.h @ 205:05154c7bb90b
* Basics of an approximate way of managing memory that we've committed to using
but haven't allocated yet
author | Chris Cannam |
---|---|
date | Fri, 15 Dec 2006 18:05:31 +0000 |
parents | 91fdc752e540 |
children | aa8dbac62024 |
line wrap: on
line diff
--- a/base/StorageAdviser.h Tue Dec 12 10:41:41 2006 +0000 +++ b/base/StorageAdviser.h Fri Dec 15 18:05:31 2006 +0000 @@ -58,6 +58,28 @@ static Recommendation recommend(Criteria criteria, int minimumSize, int maximumSize); + + enum AllocationArea { + MemoryAllocation, + DiscAllocation + }; + + /** + * Specify that we are planning to use a given amount of storage + * (in kilobytes), but haven't allocated it yet. + */ + static void notifyPlannedAllocation(AllocationArea area, int size); + + /** + * Specify that we have now allocated, or abandoned the allocation + * of, the given amount (in kilobytes) of a storage area that was + * previously notified using notifyPlannedAllocation. + */ + static void notifyDoneAllocation(AllocationArea area, int size); + +private: + static long m_discPlanned; + static long m_memoryPlanned; }; #endif