-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from alipsidikp/fix-build-error-on-arm64
fix build for different machine architecture
- Loading branch information
Showing
6 changed files
with
24 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//go:build amd64 | ||
|
||
package xxrand | ||
|
||
// https://stackoverflow.com/questions/27693145/rdtscp-versus-rdtsc-cpuid | ||
func next() uint64 |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build !amd64 | ||
|
||
package xxrand | ||
|
||
import "sync/atomic" | ||
|
||
// Next returns the next epoch for the random, when called without an explicit | ||
// epoch provided. This one simply reads a time stamp counter if available and | ||
// uses it as the epoch. | ||
var epoch uint64 | ||
|
||
// genericNext provides a cross-platform implementation, but uses atomic counter instead. | ||
func next() uint64 { | ||
return atomic.AddUint64(&epoch, 1) | ||
} |
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