Hi!

On Tue, Mar 04, 2025 at 10:02:58AM +0100, Jakub Jelinek wrote:
> The following testcases (one with #embed, one with large initializer
> turned into RAW_DATA_CST) show that I forgot to handle RAW_DATA_CST in
> module streaming.
> 
> Similar to the PCH case we need to stream out RAW_DATA_CST with NULL
> RAW_DATA_OWNER (i.e. a tree which has data owned by libcpp buffer) so
> that it will be streamed back in as STRING_CST which owns the data,
> but because the data can be really large (hopefully not so much for
> header modules though), without actually trying to build a STRING_CST
> on the module writing side because that would mean another large
> allocation and copying of the large data.
> RAW_DATA_CST with RAW_DATA_OWNER then needs to be streamed out and in
> by streaming the owner and offset from owner's data and length.

I'd like to ping this patch.  It is a P1 (#embed uses will be rare for now,
but pr119076-2_* test patterns do happen in real-world code and are regression
there).

Thanks.

> 2025-03-04  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR c++/119076
>       * module.cc (trees_out::start): Handle RAW_DATA_CST.
>       (trees_in::start): Likewise.
>       (trees_out::core_vals): Likewise.
>       (trees_in::core_vals): Likewise.
> 
>       * g++.dg/modules/pr119076-1_a.H: New test.
>       * g++.dg/modules/pr119076-1_b.C: New test.
>       * g++.dg/modules/pr119076-2_a.H: New test.
>       * g++.dg/modules/pr119076-2_b.C: New test.

        Jakub

Reply via email to