Skip to content

Commit 60b5b80

Browse files
committed
feat/cache-function-pointers
1 parent f02b3a6 commit 60b5b80

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn main(init: std.process.Init) !void {
9090
}
9191
```
9292

93-
`resolveFrom` detects the CPU, picks the best variant, and returns a typed function pointer. Detection is cached after the first call, so `resolveFrom` is safe to call in hot paths.
93+
`resolveFrom` detects the CPU, picks the best variant, and returns a typed function pointer. CPU detection is cached, so repeated calls just do a few enum comparisons — cheap enough to call inline.
9494

9595
## Shared libraries / FFI
9696

src/root.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ pub fn resolveNoIo(comptime F: type, comptime name: []const u8) F {
9090
return resolve(F, name, std.Io.Threaded.global_single_threaded.io());
9191
}
9292

93-
/// Resolve against a pre-detected level and custom level list. Use this when
94-
/// you need to resolve many functions at once or dispatch over non-default levels:
93+
/// Resolve against a pre-detected level and custom level list. Use this
94+
/// when you need custom levels or want to resolve many functions in a batch:
9595
///
9696
/// const level = oma.detectCpuLevel(io);
9797
/// const dot = oma.resolveForLevel(DotFn, "dot", levels, level);

0 commit comments

Comments
 (0)