28 #include "gc/cms/compactibleFreeListSpace.hpp"
29 #include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
30 #include "gc/cms/concurrentMarkSweepThread.hpp"
31 #include "gc/shared/blockOffsetTable.inline.hpp"
32 #include "gc/shared/collectedHeap.inline.hpp"
33 #include "gc/shared/space.inline.hpp"
34 #include "gc/shared/spaceDecorator.hpp"
35 #include "logging/log.hpp"
36 #include "logging/logStream.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "memory/binaryTreeDictionary.inline.hpp"
39 #include "memory/resourceArea.hpp"
40 #include "memory/universe.hpp"
41 #include "oops/access.inline.hpp"
42 #include "oops/compressedOops.inline.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/globals.hpp"
45 #include "runtime/handles.inline.hpp"
46 #include "runtime/init.hpp"
47 #include "runtime/java.hpp"
48 #include "runtime/orderAccess.inline.hpp"
49 #include "runtime/vmThread.hpp"
50 #include "utilities/align.hpp"
51 #include "utilities/copy.hpp"
52
53 // Specialize for AdaptiveFreeList which tries to avoid
54 // splitting a chunk of a size that is under populated in favor of
55 // an over populated size. The general get_better_list() just returns
56 // the current list.
57 template <>
58 TreeList<FreeChunk, AdaptiveFreeList<FreeChunk> >*
59 TreeList<FreeChunk, AdaptiveFreeList<FreeChunk> >::get_better_list(
60 BinaryTreeDictionary<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* dictionary) {
61 // A candidate chunk has been found. If it is already under
62 // populated, get a chunk associated with the hint for this
63 // chunk.
64
65 TreeList<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* curTL = this;
66 if (curTL->surplus() <= 0) {
67 /* Use the hint to find a size with a surplus, and reset the hint. */
68 TreeList<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* hintTL = this;
|
28 #include "gc/cms/compactibleFreeListSpace.hpp"
29 #include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
30 #include "gc/cms/concurrentMarkSweepThread.hpp"
31 #include "gc/shared/blockOffsetTable.inline.hpp"
32 #include "gc/shared/collectedHeap.inline.hpp"
33 #include "gc/shared/space.inline.hpp"
34 #include "gc/shared/spaceDecorator.hpp"
35 #include "logging/log.hpp"
36 #include "logging/logStream.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "memory/binaryTreeDictionary.inline.hpp"
39 #include "memory/resourceArea.hpp"
40 #include "memory/universe.hpp"
41 #include "oops/access.inline.hpp"
42 #include "oops/compressedOops.inline.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/globals.hpp"
45 #include "runtime/handles.inline.hpp"
46 #include "runtime/init.hpp"
47 #include "runtime/java.hpp"
48 #include "runtime/orderAccess.hpp"
49 #include "runtime/vmThread.hpp"
50 #include "utilities/align.hpp"
51 #include "utilities/copy.hpp"
52
53 // Specialize for AdaptiveFreeList which tries to avoid
54 // splitting a chunk of a size that is under populated in favor of
55 // an over populated size. The general get_better_list() just returns
56 // the current list.
57 template <>
58 TreeList<FreeChunk, AdaptiveFreeList<FreeChunk> >*
59 TreeList<FreeChunk, AdaptiveFreeList<FreeChunk> >::get_better_list(
60 BinaryTreeDictionary<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* dictionary) {
61 // A candidate chunk has been found. If it is already under
62 // populated, get a chunk associated with the hint for this
63 // chunk.
64
65 TreeList<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* curTL = this;
66 if (curTL->surplus() <= 0) {
67 /* Use the hint to find a size with a surplus, and reset the hint. */
68 TreeList<FreeChunk, ::AdaptiveFreeList<FreeChunk> >* hintTL = this;
|