{"id":13578222,"url":"https://github.com/siffiejoe/lua-getsize","last_synced_at":"2025-12-27T15:03:54.610Z","repository":{"id":147352775,"uuid":"19676601","full_name":"siffiejoe/lua-getsize","owner":"siffiejoe","description":"Matthew Wild's lua-getsize module as a rock","archived":false,"fork":false,"pushed_at":"2022-01-27T19:02:28.000Z","size":176,"stargazers_count":25,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T15:49:38.526Z","etag":null,"topics":["debugging","introspection","lua","size"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siffiejoe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-05-11T20:28:43.000Z","updated_at":"2024-08-30T09:55:52.000Z","dependencies_parsed_at":"2023-07-13T16:31:01.860Z","dependency_job_id":null,"html_url":"https://github.com/siffiejoe/lua-getsize","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siffiejoe%2Flua-getsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siffiejoe%2Flua-getsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siffiejoe%2Flua-getsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siffiejoe%2Flua-getsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siffiejoe","download_url":"https://codeload.github.com/siffiejoe/lua-getsize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247366459,"owners_count":20927517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","introspection","lua","size"],"created_at":"2024-08-01T15:01:28.537Z","updated_at":"2025-12-27T15:03:49.587Z","avatar_url":"https://github.com/siffiejoe.png","language":"C","readme":"#                             lua-getsize                            #\n\n[![Test Status](https://github.com/siffiejoe/lua-getsize/workflows/run-tests/badge.svg)](https://github.com/siffiejoe/lua-getsize/actions?workflow=run-tests)\n![License](https://img.shields.io/badge/License-MIT%2FX11,%20MIT-blue.svg)\n![Lua Versions](https://img.shields.io/badge/Lua-5.1%20|%205.2%20|%205.3%20|%205.4-blue.svg)\n![No LuaJIT](https://img.shields.io/badge/No-LuaJIT-red.svg)\n\n\n##                           Introduction                           ##\n\nThis is a bundle of Matthew Wild's lua-getsize module with the\nnecessary bits from Lua's sources (5.1, 5.2, 5.3, and 5.4) included to\nmake it build as a standalone rock.\n\nlua-getsize is MIT/X11-licensed. Lua's source code is available\nunder the MIT license.\n\n    http://code.matthewwild.co.uk/lua-getsize/\n    http://www.lua.org/\n\nAt the moment the code in this repository includes the following\nchanges to the original lua-getsize code:\n\n*   ported to Lua 5.2, 5.3 and 5.4\n*   fixed sizes of tables with empty hash part\n*   report a userdata's full memory not just its payload\n*   detect LuaJIT and raise an error\n*   additionally report the sizes of a table's array/hash parts\n*   additional option argument for counting shared internal objects\n    like Lua upvalues and/or proto objects.\n    \"p\" will count proto objects, \"P\" will _not_ count proto objects\n    (the default), \"u\" will count Lua upvalues (the default), and \"U\"\n    will _not_ count Lua upvalues. You can combine those options.\n\n\n##                          Getting Started                         ##\n\nThis module exports just one function:\n\n```lua\nlocal getsize = require(\"getsize\")\n```\n\nCalling this function with a Lua value as argument will return the\nsize of the value in bytes. For tables it will return the lengths of\narray and hash part as additional return values. For functions you can\ndecide whether you want to include the sizes of the proto object\nand/or the upvalues.\n\n```lua\nprint(getsize(getsize))                    --\u003e 64\nlocal function f() return getsize end\nprint(getsize(f))                          --\u003e 80\nprint(getsize(f, \"uP\"))                    --\u003e 80\nprint(getsize(f, \"up\"))                    --\u003e 264\nprint(getsize(f, \"UP\"))                    --\u003e 40\nprint(getsize({ 1, 2, 3, x = 4, y = 5 })   --\u003e 152  3  2\n```\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiffiejoe%2Flua-getsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiffiejoe%2Flua-getsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiffiejoe%2Flua-getsize/lists"}