Skip to content

Commit

Permalink
Merge pull request #7629 from keithc-ca/mask_check
Browse files Browse the repository at this point in the history
Move mask overlap check from omrgcconsts.h to ForwardedHeader.hpp
  • Loading branch information
babsingh authored Jan 28, 2025
2 parents 2346911 + 0d3dde4 commit c8aae7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 8 additions & 1 deletion gc/structs/ForwardedHeader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "omrcfg.h"
#include "modronbase.h"
#include "objectdescription.h"
#include "omrgcconsts.h"

#include "HeapLinkedFreeHeader.hpp"

Expand Down Expand Up @@ -72,11 +73,17 @@
* since having too many copies in parallel may be counterproductive */
#define MAX_OUTSTANDING_COPIES 4
#define SIZE_ALIGNMENT 0xfffUL
#define REMAINING_SIZE_MASK ~SIZE_ALIGNMENT
#define REMAINING_SIZE_MASK (~SIZE_ALIGNMENT)
#define OUTSTANDING_COPIES_MASK (OUTSTANDING_COPIES_MASK_BASE << OUTSTANDING_COPIES_SHIFT)
#define COPY_PROGRESS_INFO_MASK (REMAINING_SIZE_MASK | OUTSTANDING_COPIES_MASK)
#define SIZE_OF_SECTION_TO_COPY(size) ((size) >> 7)

#if !defined(OMR_OBJECT_METADATA_FLAGS_MASK)
#error "omrgcconsts.h should have defined OMR_OBJECT_METADATA_FLAGS_MASK"
#elif (0 != (OMR_OBJECT_METADATA_FLAGS_MASK & COPY_PROGRESS_INFO_MASK))
#error "mask overlap: OMR_OBJECT_METADATA_FLAGS_MASK, COPY_PROGRESS_INFO_MASK"
#endif

/**
* Scavenger forwarding header is used to distinguish objects in evacuate space that are being/have been
* copied into survivor space. Client classes provide an uintptr_t-aligned offset from the head of the
Expand Down
4 changes: 0 additions & 4 deletions include_core/omrgcconsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,6 @@ typedef enum {
#define OMR_OBJECT_METADATA_AGE_MASK 0xF0
#define OMR_OBJECT_METADATA_AGE_SHIFT 4

#if (0 != (OMR_OBJECT_METADATA_FLAGS_MASK & COPY_PROGRESS_INFO_MASK))
#error "mask overlap: OMR_OBJECT_METADATA_FLAGS_MASK, COPY_PROGRESS_INFO_MASK"
#endif

/**
* Remembered bit states overlay tenured header age flags. These are normalized to low-order byte, as above.
*/
Expand Down

0 comments on commit c8aae7c

Please sign in to comment.