runtime: replace hw.ncpu with hw.logicalcpu for Mac OS X (#8594)
ClosedPublic

Authored by ak3n on Apr 4 2016, 2:37 PM.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ak3n retitled this revision from to runtime: replace hw.ncpu with hw.logicalcpu for Mac OS X (#8594).Apr 4 2016, 2:37 PM
ak3n updated this object.
ak3n edited the test plan for this revision. (Show Details)
ak3n added a reviewer: thomie.
ak3n updated this revision to Diff 7184.Apr 4 2016, 2:42 PM
  • Forgot bracket
bgamari updated the Trac tickets for this revision.Apr 4 2016, 3:28 PM
erikd added inline comments.Apr 4 2016, 4:08 PM
rts/posix/OSThreads.c
241

Can you change these Yoda conditionals (0 != sysctlbyname....) into regular ones (ie systctbyname () != 0 and so the same for the FreeBSD one?

Yoda conditionals make no sense with modern compilers with -Wall.

erikd requested changes to this revision.Apr 4 2016, 4:08 PM
This revision now requires changes to proceed.Apr 4 2016, 4:08 PM
ak3n updated this revision to Diff 7187.Apr 4 2016, 4:53 PM
  • Forgot bracket
  • Remove Yoda conditionals
erikd accepted this revision.Apr 4 2016, 6:54 PM

Looks good to me!

This revision is now accepted and ready to land.Apr 4 2016, 6:54 PM
austin accepted this revision.Apr 5 2016, 7:38 AM

I was the first person to implement support for -N on OS X (c.f. 97c4b27494addf) in some of my earliest patches to GHC. Good memories!

This revision was automatically updated to reflect the committed changes.