Skip to content

Commit

Permalink
Fix 0 getContractionSize() in MemorySubSpaceGenerational
Browse files Browse the repository at this point in the history
Fixes a bug in Gencon where an incorrectly returned 0 contraction size
prevents additional compaction to aid contraction from occuring. The
generational memory subspace was returining its own unused field rather
than the correct contraction size of the actual sub space.

Signed-off-by: Jason Hall <jasonhal@ca.ibm.com>
  • Loading branch information
jason-hall committed Jan 6, 2021
1 parent 79c250b commit c6f0224
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gc/base/MemorySubSpace.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2020 IBM Corp. and others
* Copyright (c) 1991, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -180,7 +180,7 @@ friend class GC_MemorySubSpaceRegionIterator;
MMINLINE void isAllocatable(bool isAllocatable) {_isAllocatable = isAllocatable; }
MMINLINE bool isAllocatable() { return _isAllocatable; }

MMINLINE uintptr_t getContractionSize() const { return _contractionSize; }
virtual MMINLINE uintptr_t getContractionSize() const { return _contractionSize; }
MMINLINE uintptr_t getExpansionSize() const { return _expansionSize; }
MMINLINE void setContractionSize(uintptr_t size) { _contractionSize = size; }
MMINLINE void setExpansionSize(uintptr_t size) { _expansionSize = size; }
Expand Down
4 changes: 3 additions & 1 deletion gc/base/MemorySubSpaceGenerational.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2015 IBM Corp. and others
* Copyright (c) 1991, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -109,6 +109,8 @@ class MM_MemorySubSpaceGenerational : public MM_MemorySubSpace
virtual uintptr_t releaseFreeMemoryPages(MM_EnvironmentBase* env);
#endif

virtual MMINLINE uintptr_t getContractionSize() const { return _memorySubSpaceOld->getContractionSize(); }

/**
* Create a MemorySubSpaceGenerational object.
*/
Expand Down

0 comments on commit c6f0224

Please sign in to comment.