comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 1148:05b775309e59

6912018: CMS: guarantee(head() != 0,"The head of the list cannot be NULL") Summary: Block too small to split was not correctly putback to free lists. Reviewed-by: ysr
author jmasa
date Thu, 07 Jan 2010 08:14:45 -0800
parents e018e6884bd8
children a8127dc669ba
comparison
equal deleted inserted replaced
1147:75bd253e25dd 1148:05b775309e59
3073 rem = fc->size() - n * word_sz; 3073 rem = fc->size() - n * word_sz;
3074 // If there is a remainder, and it's too small, allocate one fewer. 3074 // If there is a remainder, and it's too small, allocate one fewer.
3075 if (rem > 0 && rem < MinChunkSize) { 3075 if (rem > 0 && rem < MinChunkSize) {
3076 n--; rem += word_sz; 3076 n--; rem += word_sz;
3077 } 3077 }
3078 assert((ssize_t)n >= 1, "Control point invariant"); 3078 // Note that at this point we may have n == 0.
3079 assert((ssize_t)n >= 0, "Control point invariant");
3080
3081 // If n is 0, the chunk fc that was found is not large
3082 // enough to leave a viable remainder. We are unable to
3083 // allocate even one block. Return fc to the
3084 // dictionary and return, leaving "fl" empty.
3085 if (n == 0) {
3086 returnChunkToDictionary(fc);
3087 return;
3088 }
3089
3079 // First return the remainder, if any. 3090 // First return the remainder, if any.
3080 // Note that we hold the lock until we decide if we're going to give 3091 // Note that we hold the lock until we decide if we're going to give
3081 // back the remainder to the dictionary, since a concurrent allocation 3092 // back the remainder to the dictionary, since a concurrent allocation
3082 // may otherwise see the heap as empty. (We're willing to take that 3093 // may otherwise see the heap as empty. (We're willing to take that
3083 // hit if the block is a small block.) 3094 // hit if the block is a small block.)