]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: 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)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 11:11:29 +0000 (13:11 +0200)
commit6e04e69bff8e92a8df0f7663f9f7d3aac1b7fd31
treeab2ebadb92378a4af58f11e5b46d7cf7c3c69c5b
parentd6332141d714888b53c1973f2d89ee24e422cb62
gccrs: 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