Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add partial support for future values of LOGICAL_PROCESSOR_RELATIONSHIP #1327

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

dbwiddis
Copy link
Contributor

See #1324 for more details.

This PR implements new LOGICAL_PROCESSOR_RELATIONSHIP enum values which are present in current Windows Insider builds and currently throw an IllegalStateException when instantiating a SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX structure from a pointer.

A complete implementation will require updating the NUMA_NODE_RELATIONSHIP structure and javadocs, and will be submitted later once the new API documentation is available.

@matthiasblaesing
Copy link
Member

I admit I have only glanced over, but just a thought - would it make sense to return a generic value holding the raw memory value when an unsupported relationship is encountered? That way people would at least get a value and not blow with an exception - especially as it is now proven, that new relationships are possible. Possible name "UNKNOWN_RELATIONSHIP".

@dbwiddis
Copy link
Contributor Author

Possible name "UNKNOWN_RELATIONSHIP".

Heh. I actually had previously implemented a similar workaround with exactly that name and am happy to go that route. My reasoning to not submit it that way was that after the new code was in we'd never use that structure again.

We'll still have the two leading int values for relationship and size; what would you suggest to retrieve the remaining data? I'm thinking no field, but a convenience getter that returns a Pointer sharing the "size" number of bytes of memory.

@dbwiddis
Copy link
Contributor Author

Actually such a getter isn't needed, the structure itself already has a getPointer() that returns the same thing.

@matthiasblaesing
Copy link
Member

Looks sane to me.

@dbwiddis dbwiddis merged commit 58bc0a0 into java-native-access:master Mar 17, 2021
@dbwiddis dbwiddis deleted the logproc branch March 17, 2021 19:55
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.

None yet

2 participants