]> git.ipfire.org Git - thirdparty/gcc.git/commit
libformat_parser: Send boxed values across FFI properly
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 00:48:13 +0000 (01:48 +0100)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 26 Feb 2024 17:32:38 +0000 (17:32 +0000)
commitad905fe5164bd4a7b41172708256fe04d0a80c8d
treed165d7e08b9708f1c975415e692c243855c4d6be
parentb49f87f6931fa1f42b9a49e7dccd38b0afe3442d
libformat_parser: Send boxed values across FFI properly

gcc/rust/ChangeLog:

* ast/rust-fmt.cc (Pieces::~Pieces): Call libformat_parser's release
function in destructor.
* ast/rust-fmt.h (struct PieceSlice): Add capacity.
(destroy_pieces): New.
(struct Pieces): Add destructor.

libgrust/ChangeLog:

* libformat_parser/src/lib.rs: Leak Boxes properly for C++ to
see them, add memory release function.
gcc/rust/ast/rust-fmt.cc
gcc/rust/ast/rust-fmt.h
libgrust/libformat_parser/src/lib.rs