*/
#include <cutils/mspace.h>
-#include <limits.h> // for SIZE_T_MAX
+#include <limits.h> // for UINT_MAX
#include <sys/mman.h>
#include <errno.h>
static inline bool
softLimited(const HeapSource *hs)
{
- /* softLimit will be either SIZE_T_MAX or the limit for the
+ /* softLimit will be either UINT_MAX or the limit for the
* active mspace. idealSize can be greater than softLimit
* if there is more than one heap. If there is only one
- * heap, a non-SIZE_T_MAX softLimit should always be the same
+ * heap, a non-UINT_MAX softLimit should always be the same
* as idealSize.
*/
return hs->softLimit <= hs->idealSize;
if (msp != NULL) {
heap.msp = msp;
heap.absoluteMaxSize = mspAbsoluteMaxSize;
- heap.concurrentStartBytes = SIZE_T_MAX;
+ heap.concurrentStartBytes = UINT_MAX;
heap.base = hs->heapBase;
heap.limit = hs->heapBase + heap.absoluteMaxSize;
} else {
hs->startSize = startSize;
hs->absoluteMaxSize = absoluteMaxSize;
hs->idealSize = startSize;
- hs->softLimit = SIZE_T_MAX; // no soft limit at first
+ hs->softLimit = UINT_MAX; // no soft limit at first
hs->numHeaps = 0;
hs->sawZygote = gDvm.zygote;
hs->hasGcThread = false;
/* We're soft-limited. Try removing the soft limit to
* see if we can allocate without actually growing.
*/
- hs->softLimit = SIZE_T_MAX;
+ hs->softLimit = UINT_MAX;
ptr = dvmHeapSourceAlloc(n);
if (ptr != NULL) {
/* Removing the soft limit worked; fix things up to
snapIdealFootprint();
return ptr;
}
- // softLimit intentionally left at SIZE_T_MAX.
+ // softLimit intentionally left at UINT_MAX.
}
/* We're not soft-limited. Grow the heap to satisfy the request.
* soft limit, if set.
*/
mspace_set_max_allowed_footprint(msp, softLimit);
- hs->softLimit = SIZE_T_MAX;
+ hs->softLimit = UINT_MAX;
}
}
freeBytes = getAllocLimit(hs);
if (freeBytes < CONCURRENT_MIN_FREE) {
/* Not enough free memory to allow a concurrent GC. */
- heap->concurrentStartBytes = SIZE_T_MAX;
+ heap->concurrentStartBytes = UINT_MAX;
} else {
heap->concurrentStartBytes = freeBytes - CONCURRENT_START;
}