-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved affinity to tests Fixed strange output from mask_to_string
- Loading branch information
Showing
6 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright (c) 2019, jtgrassie | ||
Copyright (c) 2019, tevador <[email protected]> | ||
All rights reserved. | ||
|
@@ -26,6 +27,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include <sstream> | ||
|
||
#if defined(_WIN32) || defined(__CYGWIN__) | ||
#include <windows.h> | ||
#else | ||
|
@@ -95,20 +98,20 @@ cpuid_from_mask(uint64_t mask, const unsigned &thread_index) | |
std::string | ||
mask_to_string(uint64_t mask) | ||
{ | ||
std::string r(65, '\0'); | ||
std::ostringstream ss; | ||
unsigned len = 0; | ||
unsigned v = 0; | ||
unsigned i = 64; | ||
while (i--) | ||
{ | ||
v = mask >> i; | ||
if (1ULL & v) | ||
{ | ||
if (len == 0) len = i+1; | ||
r[len-i] = '1'; | ||
} | ||
else | ||
if (len > 0) r[len-i] = '0'; | ||
if (1ULL & v) | ||
{ | ||
if (len == 0) len = i + 1; | ||
ss << '1'; | ||
} | ||
else | ||
if (len > 0) ss << '0'; | ||
} | ||
return r; | ||
return ss.str(); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters