From: Barry Hayes Date: Fri, 3 Sep 2010 21:26:12 +0000 (-0700) Subject: The host build lacks SIZE_T_MAX, even though bionic has it. X-Git-Tag: android-x86-4.0-r1~298^2~63 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=562cafca106d36ae910fafa87f3d5f245fe818ae;p=android-x86%2Fdalvik.git The host build lacks SIZE_T_MAX, even though bionic has it. Change SIZE_T_MAX to UINT_MAX. Change-Id: Icbf74abb26cac680ff1b470260c1fba6991bc975 --- diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c index 3b344d99f..a45fb4252 100644 --- a/vm/alloc/HeapSource.c +++ b/vm/alloc/HeapSource.c @@ -15,7 +15,7 @@ */ #include -#include // for SIZE_T_MAX +#include // for UINT_MAX #include #include @@ -225,10 +225,10 @@ struct HeapSource { 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; @@ -391,7 +391,7 @@ addNewHeap(HeapSource *hs, mspace msp, size_t mspAbsoluteMaxSize) 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 { @@ -537,7 +537,7 @@ dvmHeapSourceStartup(size_t startSize, size_t absoluteMaxSize) 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; @@ -910,7 +910,7 @@ dvmHeapSourceAllocAndGrow(size_t n) /* 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 @@ -919,7 +919,7 @@ dvmHeapSourceAllocAndGrow(size_t n) 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. @@ -1172,7 +1172,7 @@ setSoftLimit(HeapSource *hs, size_t softLimit) * soft limit, if set. */ mspace_set_max_allowed_footprint(msp, softLimit); - hs->softLimit = SIZE_T_MAX; + hs->softLimit = UINT_MAX; } } @@ -1413,7 +1413,7 @@ void dvmHeapSourceGrowForUtilization() 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; }