Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-9729

Make VLA use up less of the heap

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Medium Medium

      As currently supplied, using just one VLA in a program requires about 32K of heap. On space limited systems, that's a lot. Somehow change the implementation so that less heap memory is required. See the related forum thread for more of the use case background.

      One idea to consider ... In vla_alloc.c there is this preprocessor setting ...

      /*
      Relatively small VLAs are allocated within blocks of NORMAL_BLOCK_SIZE bytes.
      It is usually a good idea to choose this number to be a little smaller than
      a power of 2 since many malloc implementations handle those values best.
      */
      #define NORMAL_BLOCK_SIZE       32700
      

      Consider making NORMAL_BLOCK_SIZE something that is defined at link time, similar to how the size of the stack and heap are handled.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: