Skip to content

Add groupCount/groupMasks to CACHE_RELATIONSHIP#1720

Open
dbwiddis wants to merge 1 commit intojava-native-access:masterfrom
dbwiddis:fix-cache-relationship-groupcount
Open

Add groupCount/groupMasks to CACHE_RELATIONSHIP#1720
dbwiddis wants to merge 1 commit intojava-native-access:masterfrom
dbwiddis:fix-cache-relationship-groupcount

Conversation

@dbwiddis
Copy link
Copy Markdown
Contributor

Add groupCount/groupMasks to CACHE_RELATIONSHIP

The Windows CACHE_RELATIONSHIP struct was updated (Windows Server 2022 / 21H2) to repurpose 2 of its 20 reserved bytes as a GroupCount field and replace the single GroupMask with a variable-length GroupMasks array. This is the same change documented in #1324 for NUMA_NODE_RELATIONSHIP.

Changes

  • Shrink reserved from 20 to 18 bytes
  • Add groupCount (short) field
  • Add groupMasks (GROUP_AFFINITY[]) array
  • Retain groupMask as a public compatibility field (populated from groupMasks[0])
  • Override read() to dynamically size the array based on groupCount
  • Override getFieldList() to exclude the compatibility groupMask field from structure validation

Sources

Backward compatibility

On older Windows versions where GroupCount is 0 (the bytes were previously reserved/zeroed), the read() override forces a minimum array size of 1 and copies the value to groupMask, preserving existing behavior.

Closes #1674

Closes java-native-access#1674

The Windows CACHE_RELATIONSHIP struct was updated to use 2 of its
reserved bytes for a GroupCount field and replace the single
GroupMask with a variable-length GroupMasks array, matching the
same change previously made to NUMA_NODE_RELATIONSHIP.

Shrink reserved from 20 to 18 bytes, add groupCount (short) and
groupMasks array with a read() override to handle both old and new
struct layouts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinNT CACHE_RELATIONSHIP uses 2 reserved bytes for Group Count

1 participant