Skip to content

Commit

Permalink
Remove unused duplicated field from MM_AllocateInitialization
Browse files Browse the repository at this point in the history
_requestedSizeInBytes field in not used (and even not initialized
properly for arrays). This field is a duplicate for
_allocateDescription->_requestedBytes. The correspondent helper
getRequestedSizeInBytes() is not used and can be removed as well.

Signed-off-by: Dmitri Pivkine <[email protected]>
  • Loading branch information
dmitripivkine committed Nov 9, 2023
1 parent 01e77f6 commit 876ead5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gc/base/AllocateInitialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class MM_AllocateInitialization : public MM_Base

protected:
const uintptr_t _allocationCategory; /**< language-defined object category used in GC_ObjectModel::initializeAllocation() */
const uintptr_t _requestedSizeInBytes; /**< minimum number of bytes to allocate for object header+instance data */
bool _isAllocatable; /**< this is set if the allocation should not proceed */

MM_AllocateDescription _allocateDescription;/**< mutable allocation descriptor holds actual allocation terms */
Expand Down Expand Up @@ -139,7 +138,6 @@ class MM_AllocateInitialization : public MM_Base
MMINLINE bool isAllocatable() { return _isAllocatable; }

MMINLINE uintptr_t getAllocationCategory() { return _allocationCategory; }
MMINLINE uintptr_t getRequestedSizeInBytes() { return _requestedSizeInBytes; }
MMINLINE MM_AllocateDescription *getAllocateDescription() { return &_allocateDescription; }

MMINLINE bool
Expand Down Expand Up @@ -270,9 +268,8 @@ class MM_AllocateInitialization : public MM_Base
uintptr_t objectAllocationFlags = 0
) : MM_Base()
, _allocationCategory(allocationCategory)
, _requestedSizeInBytes(requiredSizeInBytes)
, _isAllocatable(true)
, _allocateDescription(_requestedSizeInBytes, objectAllocationFlags,
, _allocateDescription(requiredSizeInBytes, objectAllocationFlags,
0 == (OMR_GC_ALLOCATE_OBJECT_NO_GC & objectAllocationFlags),
0 == (OMR_GC_ALLOCATE_OBJECT_NO_GC & objectAllocationFlags))
{
Expand Down

0 comments on commit 876ead5

Please sign in to comment.