[Snek] [keith-packard/snek] a67570: test: Add test for doing string interpolation of g...

Keith Packard noreply at github.com
Mon Dec 2 00:28:35 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/keith-packard/snek
  Commit: a67570331c3dbcd58e605e1f0c85149c76f49487
      https://github.com/keith-packard/snek/commit/a67570331c3dbcd58e605e1f0c85149c76f49487
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-12-02 (Mon, 02 Dec 2019)

  Changed paths:
    M test/Makefile
    A test/interpolate-list.py

  Log Message:
  -----------
  test: Add test for doing string interpolation of growing list value

String interpolation of lists allocates a lot of bits of memory and
requires care to track possible location changes across collect calls
in many places. Test this by doing string interpolation of a sequence
of lists.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: ef617b7d6c8b2bb3fac953cd4faa8aafcc0dc251
      https://github.com/keith-packard/snek/commit/ef617b7d6c8b2bb3fac953cd4faa8aafcc0dc251
  Author: Keith Packard <keithp at keithp.com>
  Date:   2019-12-02 (Mon, 02 Dec 2019)

  Changed paths:
    M snek-print.c

  Log Message:
  -----------
  save/restore 'list' value during string interpolation

Each put_c or snek_poly_format call does allocation and may end up
performing a collect, which will move the 'list' value
around. Save/restore the list value across sequences of those
calls. Pull the 'size' value out of the list instead of fetching each
time, while *not* pulling the data value out as that only gets used in
one place and would need re-fetching anyways.

Signed-off-by: Keith Packard <keithp at keithp.com>


Compare: https://github.com/keith-packard/snek/compare/e8e1f3315676...ef617b7d6c8b


More information about the Snek mailing list