fresh-borzoni commented on PR #138: URL: https://github.com/apache/fluss-rust/pull/138#issuecomment-3733263191
I’m not convinced the transmute approach is sound here. CompactedRow<'a> is public and 'a is unconstrained (constructors don’t tie it to any input), so a caller can choose 'a = 'static. With mem::transmute we can then manufacture 'static references into row.segment, and after the row is dropped those references dangle → use-after-free / UB. This isn’t about address stability; it’s about lifetime validity. I strongly prefer the Cow approach for Datum (Cow<str>, Cow<[u8]>): it keeps the borrow checker honest, avoids unsafe, and still allows zero-copy via Borrowed when the backing buffer is known to outlive the use-site, while preserving Owned for Python/async boundaries. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
