Update rust-cpuid to support libcpuid 0.4.0 #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This commit updates rust-cpuid to support libcpuid
version
0.4.0
, mostly updating the structures andtheir allocation. It includes:
MAX_INTELFN4_LEVEL
tousize 8
cpu_raw_data_t
with new intel fieldscpu_id_t
to include new fields with sgx supportCPUFeature
to include new featuresDefault::default()
instead ofmem::uninitialized()
Regarding that last point, I'm not extremely familiar with undefined behavior (still fighting my way through the rustonomicon), thus I changed back to using
default()
instead ofmem::uninitialized()
. Looking at the documentation it seems that usingmem::uninitialized()
is considered harmful. But I can update the PR and change this back if this is the preferred way to deal with initializing the structs.Not sure if this is going to pass through the CI but let's see! :)
Thanks for the lib!
Signed-off-by: Alexandre Beslic [email protected]