Skip to content

collectgarbage ignores its option: "count" returns no value #546

Description

@eldologuzzo
  • GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
  • GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.
  1. What version of GopherLua are you using? : master (75f4976) and v1.1.1
  2. What version of Go are you using? : 1.26.2
  3. What operating system and processor architecture are you using? : darwin/arm64
  4. What did you do? :
print(type(collectgarbage("count")), select("#", collectgarbage("count")))
print(collectgarbage("setpause", 150))
  1. What did you expect to see? : Lua 5.1.5:
number	1
200
  1. What did you see instead? :
bad argument #1 to type (value expected)

baseCollectGarbage always runs runtime.GC() and returns no value, whatever the option. collectgarbage("count") is the usual way scripts report their memory (for example collectgarbage("count") * 1024), and it fails. Invalid options are not reported either.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions