Skip to content
Snippets Groups Projects
  1. Jun 06, 2019
  2. Jun 05, 2019
  3. Jun 04, 2019
    • Roberto Ierusalimschy's avatar
      Function 'warn' is vararg · 14edd364
      Roberto Ierusalimschy authored
      Instead of a 'tocont' flag, the function 'warn' in Lua now receives all
      message pieces as multiple arguments in a single call. Besides being
      simpler to use, this implementation ensures that Lua code cannot create
      unfinished warnings.
      14edd364
  4. Jun 03, 2019
  5. May 28, 2019
    • Roberto Ierusalimschy's avatar
      Improvements in 'luaL_traceback' · 2b8b5386
      Roberto Ierusalimschy authored
      'luaL_traceback' changed to use an aux buffer instead of concats.
      This should reduce the quantity of garbage it generates (in the
      form of intermediate strings) while producing a trackback.
      It also added information about the number of levels skipped when
      skipping levels in a trace.
      2b8b5386
    • Roberto Ierusalimschy's avatar
      Details · b293ae05
      Roberto Ierusalimschy authored
      - new error message for "attempt to assign to const variable"
      - note in the manual about compatibility options
      - comments
      - small changes in 'read_line' and 'pushstr'
      b293ae05
  6. May 17, 2019
  7. May 14, 2019
  8. May 13, 2019
  9. May 09, 2019
    • Roberto Ierusalimschy's avatar
      Flag for to-be-closed variables changed to '<toclose>' · d881325c
      Roberto Ierusalimschy authored
      The flag for to-be-closed variables was changed from '*toclose'
      to '<toclose>'. Several people found confusing the old syntax and
      the new one has a clear terminator, making it more flexible for
      future changes.
      d881325c
    • Roberto Ierusalimschy's avatar
      Test for dead coroutine moved to 'lua_resume' · 3f253f11
      Roberto Ierusalimschy authored
      The test for dead coroutines done in the 'coro' library was moved
      to 'lua_resume', in the kernel, which already does other similar
      tests.
      3f253f11
    • Roberto Ierusalimschy's avatar
      Coroutines do not unwind the stack in case of errors · 389116d8
      Roberto Ierusalimschy authored
      Back to how it was, a coroutine does not unwind its stack in case of
      errors (and therefore do not close its to-be-closed variables). This
      allows the stack to be examined after the error. The program can
      use 'coroutine.kill' to close the variables.
      
      The function created by 'coroutine.wrap', however, closes the
      coroutine's variables in case of errors, as it is impossible to examine
      the stack any way.
      389116d8
  10. May 03, 2019
    • Roberto Ierusalimschy's avatar
      File 'lib2-v2.so' generated from its own source · 01bded3d
      Roberto Ierusalimschy authored
      Instead of being a copy of 'lib2.so', 'lib2-v2.so' has its own source
      file ('lib22.c'), so that the test can distinguish both libraries.
      01bded3d
    • Roberto Ierusalimschy's avatar
      A few more improvements in 'luaO_pushvfstring' · 7c578647
      Roberto Ierusalimschy authored
      - 'L' added to the 'BuffFS' structure
      - '%c' does not handle control characters (it is not its business.
      This now is done by the lexer, who is the one in charge of that
      kind of errors.)
      - avoid the direct use of 'l_sprintf' in the Lua kernel
      7c578647
    • Roberto Ierusalimschy's avatar
      Avoid the creation of too many strings in 'package' · b1460903
      Roberto Ierusalimschy authored
      Both when setting a path and searching for a file ('searchpath'),
      this commit reduces the number of intermediate strings created
      in Lua.
      (For setting a path the change is not relevant, because this is
      done only twice when loading the module. Anyway, it is a nice example
      of how to use auxlib buffers to manipulate strings in the C API.)
      b1460903
  11. Apr 26, 2019
  12. Apr 24, 2019
    • Roberto Ierusalimschy's avatar
      New function 'luaL_addgsub' · c6560515
      Roberto Ierusalimschy authored
      Added a new function 'luaL_addgsub', similar to 'luaL_gsub' but that
      adds its result directly to a preexisting buffer, avoiding the creation
      of one extra intermediate string. Also added two simple macros,
      'luaL_bufflen' and 'luaL_buffaddr', to query the current length
      and the contents address of a buffer.
      c6560515
    • Roberto Ierusalimschy's avatar
      Revamp of 'lua_pushfstring' / 'luaO_pushvfstring' · 3da34a5f
      Roberto Ierusalimschy authored
      The function 'luaO_pushvfstring' now uses an internal buffer to
      concatenate small strings, instead of pushing all pieces on the
      stack. This avoids the creation of several small Lua strings for each
      piece of the result. (For instance, a format like "n: '%d'" used to
      create three intermediate strings: "n: '", the numeral, and "'".
      Now it creates none.)
      3da34a5f
  13. Apr 22, 2019
  14. Apr 17, 2019
  15. Apr 12, 2019
    • Roberto Ierusalimschy's avatar
      Avoid using large buffers in 'string.format' · 2d3f0954
      Roberto Ierusalimschy authored
      The result of "string.format("%.99f", -1e308) is 410 characters long,
      but all other formats have much smaller limits (at most 99 plus a fex
      extras). This commit avoids 'string.format' asking for a buffer
      ~400 chars large when ~100 will do.
      2d3f0954
  16. Apr 11, 2019
    • Roberto Ierusalimschy's avatar
      Small optimizations in 'string.gsub' · b0810c51
      Roberto Ierusalimschy authored
      Avoid creating extra strings when possible:
      
      - avoid creating new resulting string when subject was not modified
      (instead, return the subject itself);
      
      - avoid creating strings representing the captured substrings when
      handling replacements like '%1' (instead, add the substring directly
      to the buffer).
      b0810c51
  17. Apr 10, 2019
  18. Apr 09, 2019
  19. Apr 04, 2019
  20. Apr 01, 2019
  21. Mar 27, 2019
    • Roberto Ierusalimschy's avatar
      Small optimizations in range checks · d1226206
      Roberto Ierusalimschy authored
      Checks of the form '1 <= x && x <= M' were rewritten in the form
      '(unsigned)x - 1 < (unsigned)M', which is usually more efficient.
      (Other similar checks have similar translations.) Although
      some compilers do these optimizations, that does not happen
      for all compilers or all cases.
      d1226206
  22. Mar 25, 2019
Loading