Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karwa
Copy link
Owner

@karwa karwa commented Dec 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant