-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Shim'ing out the processor affinity function calls for the Linux kernel #3798
Conversation
LGTM |
internal static unsafe extern void CpuSet(int cpu, CpuSetBits* set); | ||
|
||
[DllImport(Libraries.SystemNative)] | ||
internal static unsafe extern bool CpuIsSet(int cpu, CpuSetBits* set); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these functions use ref/out rather than pointers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
A few comments/questions, but otherwise LGTM. |
{ | ||
internal static partial class Sys | ||
{ | ||
internal unsafe struct CpuSetBits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thought. Since the Bits field is never used and is here purely to impact the size of the struct, you could just add a StructLayout attribute to the type to set its size to 128. Then the type wouldn't need to be unsafe. But if you'd prefer to stick with what you have, that's fine, though you might chaynge the visibility of Bits to be private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the field to be private so that it's still visible what the struct contains and how it fits with the native implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
LGTM |
Everything is green with LGTM's....merging. Thanks folks! |
Shim'ing out the processor affinity function calls for the Linux kernel
Shim'ing out the processor affinity function calls for the Linux kernel Commit migrated from dotnet/corefx@7691049
Shim'ing out the processor affinity function calls for the Linux kernel
/cc @nguerrera @stephentoub