uniqueid icon indicating copy to clipboard operation
uniqueid copied to clipboard

[Won't merge] Use stdlib random API directly via a C shim

Open karwa opened this issue 4 years ago • 0 comments

Use the standard library's random API via a C shim, so we're not limited to 8 bytes per syscall.

Technically, the compiler headers say:

/// SWIFT_RUNTIME_STDLIB_API functions are called by compiler-generated code
/// or by @inlinable Swift code.
/// Such functions must be exported and must be supported forever as API.
/// The function name should be prefixed with `swift_`.

So... it's not unsafe or unsupported ("must be supported forever"). But it's hacky.

It's interesting for benchmarks, but I don't think this should be merged. We should fix the standard library instead.

karwa avatar Dec 18 '21 18:12 karwa