-
Notifications
You must be signed in to change notification settings - Fork 901
Introspection: emit messages inline in the binaries instead of introducing a ptr+len indirection #5450
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
Conversation
13c7df2 to
5ce2a1f
Compare
3d2f822 to
c808cc4
Compare
…ucing a ptr+len indirection Significantly simplifies the parsing I dropped the old code path, we can add it back if we want to maintain backward compatibility
| Chunk::deserialize(&mut Deserializer::from_slice(chunk)).with_context(|| { | ||
| // We take the first valid utf8 bytes, it's quite likely to be the actual chunk | ||
| // We use a 4096 upper bound for security | ||
| let chunk = str::from_utf8(&chunk[..4096]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this also breaks if the annotation is greater than 4096 chars?
Should we potentially store each static as a #[repr(C)] struct of u32 size and then the bytes, so that we still have a length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great idea. I'm going to implement it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this also breaks if the annotation is greater than 4096 chars?
Yes, but it's only an error message so I am not sure it's a big deal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in c2d6a41
davidhewitt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for identifying and fixing!
|
@davidhewitt There was an issue with the expected stub files. Fix: aa65fff |
Significantly simplifies the parsing by avoiding to resolve pointers and fixes compatibility with LLD
I dropped the old code path, we can add it back if we want to maintain backward compatibility
Thanks to uniffi for the inspiration