Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: C++ compiler excessive memory usage?



On Mon, Oct 12, 2026 at 05:54:12PM +0200, Havard Eidnes wrote:
> The file from 19% to 99% consists of this function which has a
> single static table inside of it:
> 
> const uint8_t *RISCVInstructionSelector::getMatchTable() const {
> 
>   constexpr static uint8_t MatchTable0[] = {
> ....
>   };
>   return MatchTable0;
> }

Oh *******,

try to patch it like this?

const uint8_t *RISCVInstructionSelector::getMatchTable() const {
   static const uint8_t MatchTable0[] = {
	 ....
   };
   return MatchTable0;
}

Not sure what it buys the other way if the function is not
declared as constexpr (besides driving the commpiler mad).

Martin


Home | Main Index | Thread Index | Old Index