dep-protobuf/rust/cpp_kernel
Adam Cozzette dc23fedbf3 Simplify the way C++ function is passed to UntypedMapIterator::next_unchecked
`UntypedMapIterator::next_unchecked` currently expects to be passed a pointer
to a C++ function that it can use to dereference an iterator. However, this is
awkward because it's not natural for this C++ function to have the same
signature for every map type. Maps with a message as value need a
`MapNodeSizeInfo`, but other map types do not. We are working around this by
sometimes passing an ignored placeholder constant, but this is messy.

This CL replaces the `extern "C"` functions with closures. This way, we can
capture the `MapNodeSizeInfo` in the closure in cases where we need it, but
otherwise we no longer need to pass around placeholder values.

(Note: `MapNodeSizeInfo` is going away soon, but this is still relevant because
it will likely need to be replaced by a message default instance pointer.)

PiperOrigin-RevId: 676438640
2024-09-19 09:14:56 -07:00
..
BUILD Replace some per-message C++ thunks with a common implementation 2024-08-21 09:34:25 -07:00
compare.cc Set up for Rust-cpp Protobuf implementation message matcher. 2024-08-01 07:52:17 -07:00
compare.h Set up for Rust-cpp Protobuf implementation message matcher. 2024-08-01 07:52:17 -07:00
debug.cc Enable MessageLite::DebugString to use Message::DebugString where possible. 2024-07-03 09:37:37 -07:00
debug.h Enable MessageLite::DebugString to use Message::DebugString where possible. 2024-07-03 09:37:37 -07:00
map.cc Move -Werror to our test/dev bazelrc files. 2024-08-23 13:26:32 -07:00
map.h Simplify the way C++ function is passed to UntypedMapIterator::next_unchecked 2024-09-19 09:14:56 -07:00
message.cc Replace some per-message C++ thunks with a common implementation 2024-08-21 09:34:25 -07:00
repeated.cc Move -Werror to our test/dev bazelrc files. 2024-08-23 13:26:32 -07:00
rust_alloc_for_cpp_api.h Change to proto2_rust C prefix and proto2::rust C++ namespace 2024-07-02 11:44:17 -07:00
rust_alloc_for_cpp_api.rs Change to proto2_rust C prefix and proto2::rust C++ namespace 2024-07-02 11:44:17 -07:00
serialized_data.h Make SerializedData into a POD struct. 2024-09-18 14:17:14 -07:00
strings.cc Move -Werror to our test/dev bazelrc files. 2024-08-23 13:26:32 -07:00
strings.h Move -Werror to our test/dev bazelrc files. 2024-08-23 13:26:32 -07:00