You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#636 added [Rc|Stack]Block::with_encoding, but they're pretty cumbersome to use because you have to create a helper structure, and implement ManualBlockEncoding with the correct encoding.
What's the solution when something is cumbersome? Make it automatic!
An idea would be to write a script that uses libclang, goes through all Apple's headers, on a few different targets, and generates the correct ManualBlockEncoding for the corresponding fn(A) -> Rs.
This would allow the user to write RcBlock::with_encoding<fn(i32) -> i32, _, _>(|x| x * x) in the vast majority of cases.
I recall having a quick look at the amount of block signatures that Apple uses a month back, and it was unfortunately several hundred, which is probably too large a compile-time hit :/.
So we'll probably have to wait for generic const expressions (see 050b502 for a test with that).
Activity
madsmtm commentedon Sep 8, 2025
I recall having a quick look at the amount of block signatures that Apple uses a month back, and it was unfortunately several hundred, which is probably too large a compile-time hit :/.
So we'll probably have to wait for generic const expressions (see 050b502 for a test with that).
madsmtm commentedon Mar 4, 2026
An idea from #70: Since we can generate encoding strings in
const, just not generically, maybe add something like:And maybe wrap it in a macro like: