Skip to content

Array with size > 8GB generated, invalid on 32-bit targets #183

Open

Description

@acoplan-arm

With the seed 10690367908864332818 (on commit 29a67b2), I see YARPGen producing a very large array (on line 37 in this case):

short arr_16 [24] [24] [24] [24] [24] [24] [24] ;

which is more than 8GB and therefore clearly can't work on 32-bit targets (see e.g. https://godbolt.org/z/Pc9773zxq).

More generally, I think it would be useful to have tuning parameters to limit:

  • The maximum size of an individual array in YARPGen.
  • The total size of all arrays / global variables produced by YARPGen.

Activity

  1. Vsevolod-Livinskij commented on Jun 19, 2023

    @Vsevolod-Livinskij
    Contributor

    Thanks for reporting the issue!

    You can limit the maximal number of the array's dimensions in this line. To change the maximal number of elements in the dimension itself, you can change this limit.
    You can try to lower the total size of the generated program using this limit. But it is probably a good idea to have a global switch that will limit the total memory consumption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions