]> git.proxmox.com Git - cargo.git/commit
Auto merge of #7429 - alexcrichton:fix-osx-cpu, r=ehuss
authorbors <bors@rust-lang.org>
Wed, 25 Sep 2019 17:00:56 +0000 (17:00 +0000)
committerbors <bors@rust-lang.org>
Wed, 25 Sep 2019 17:00:56 +0000 (17:00 +0000)
commitab6fa8908c9b6c8f7e2249231c395eebfbc49891
tree83e1ff5f6bdecb6eb5c5a13004f045985480b65c
parent249b31b6a9e1d03f84543d2992923228af7ae1a1
parent0c812dbe963553986c8fd5508e66622c8de88a29
Auto merge of #7429 - alexcrichton:fix-osx-cpu, r=ehuss

Fix macOS collection of CPU data

There's very little documentation on `host_processor_info` from what I can tell, so I'm just cribbing examples I've found elsewhere on the internet. Turns out two things were wrong:

* One is that `host_processor_info` returns allocated memory we need to deallocate. Who knew!
* Next is that one of the out parameters, `cpu_info_cnt`, is only somehow related to the size of the return, but all example code appears to just read data regardless of what it is.

In any case this commit reads [libuv's implementation](https://github.com/libuv/libuv/blob/040543eebf4983b1459a1e0e0e26dae68b80cc28/src/unix/darwin.c#L174-L225) which if good enough for node.js is probably good enough for us.

Closes #7427