mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Internals: Move vl_timescaled_double to verilated_funcs.h. No functional change intended
This commit is contained in:
+4
-2
@@ -372,7 +372,9 @@ string V3Os::trueRandom(size_t size) VL_MT_SAFE {
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
const NTSTATUS hr = BCryptGenRandom(nullptr, reinterpret_cast<BYTE*>(data), size,
|
||||
BCRYPT_USE_SYSTEM_PREFERRED_RNG);
|
||||
if (!BCRYPT_SUCCESS(hr)) v3fatal("Could not acquire random data.");
|
||||
if (VL_UNCOVERABLE(!BCRYPT_SUCCESS(hr))) {
|
||||
v3fatal("Could not acquire random data. Try specifying a key instead."); // LCOV_EXCL_LINE
|
||||
}
|
||||
#else
|
||||
std::ifstream is{"/dev/urandom", std::ios::in | std::ios::binary};
|
||||
// This read uses the size of the buffer.
|
||||
@@ -418,7 +420,7 @@ uint64_t V3Os::memUsageBytes() {
|
||||
#else
|
||||
// Highly unportable. Sorry
|
||||
const char* const statmFilename = "/proc/self/statm";
|
||||
FILE* fp = fopen(statmFilename, "r");
|
||||
FILE* const fp = fopen(statmFilename, "r");
|
||||
if (!fp) return 0;
|
||||
uint64_t size, resident, share, text, lib, data, dt; // All in pages
|
||||
const int items = fscanf(
|
||||
|
||||
Reference in New Issue
Block a user