Mercurial > hg > truffle
comparison src/share/vm/memory/heap.cpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | d8041d695d19 |
children | b51e29501f30 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
181 | 181 |
182 void* CodeHeap::allocate(size_t instance_size, bool is_critical) { | 182 void* CodeHeap::allocate(size_t instance_size, bool is_critical) { |
183 size_t number_of_segments = size_to_segments(instance_size + sizeof(HeapBlock)); | 183 size_t number_of_segments = size_to_segments(instance_size + sizeof(HeapBlock)); |
184 assert(segments_to_size(number_of_segments) >= sizeof(FreeBlock), "not enough room for FreeList"); | 184 assert(segments_to_size(number_of_segments) >= sizeof(FreeBlock), "not enough room for FreeList"); |
185 | 185 |
186 // First check if we can satify request from freelist | 186 // First check if we can satisfy request from freelist |
187 debug_only(verify()); | 187 debug_only(verify()); |
188 HeapBlock* block = search_freelist(number_of_segments, is_critical); | 188 HeapBlock* block = search_freelist(number_of_segments, is_critical); |
189 debug_only(if (VerifyCodeCacheOften) verify()); | 189 debug_only(if (VerifyCodeCacheOften) verify()); |
190 if (block != NULL) { | 190 if (block != NULL) { |
191 assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check"); | 191 assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check"); |
370 b->set_link(NULL); | 370 b->set_link(NULL); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 // Scan for right place to put into list. List | 374 // Scan for right place to put into list. List |
375 // is sorted by increasing addresseses | 375 // is sorted by increasing addresses |
376 FreeBlock* prev = NULL; | 376 FreeBlock* prev = NULL; |
377 FreeBlock* cur = _freelist; | 377 FreeBlock* cur = _freelist; |
378 while(cur != NULL && cur < b) { | 378 while(cur != NULL && cur < b) { |
379 assert(prev == NULL || prev < cur, "must be ordered"); | 379 assert(prev == NULL || prev < cur, "must be ordered"); |
380 prev = cur; | 380 prev = cur; |