Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
204:29b70bdaacdc | 205:05154c7bb90b |
---|---|
56 * be nowhere the minimum amount of data can be stored. | 56 * be nowhere the minimum amount of data can be stored. |
57 */ | 57 */ |
58 static Recommendation recommend(Criteria criteria, | 58 static Recommendation recommend(Criteria criteria, |
59 int minimumSize, | 59 int minimumSize, |
60 int maximumSize); | 60 int maximumSize); |
61 | |
62 enum AllocationArea { | |
63 MemoryAllocation, | |
64 DiscAllocation | |
65 }; | |
66 | |
67 /** | |
68 * Specify that we are planning to use a given amount of storage | |
69 * (in kilobytes), but haven't allocated it yet. | |
70 */ | |
71 static void notifyPlannedAllocation(AllocationArea area, int size); | |
72 | |
73 /** | |
74 * Specify that we have now allocated, or abandoned the allocation | |
75 * of, the given amount (in kilobytes) of a storage area that was | |
76 * previously notified using notifyPlannedAllocation. | |
77 */ | |
78 static void notifyDoneAllocation(AllocationArea area, int size); | |
79 | |
80 private: | |
81 static long m_discPlanned; | |
82 static long m_memoryPlanned; | |
61 }; | 83 }; |
62 | 84 |
63 #endif | 85 #endif |
64 | 86 |