{"id":13817076,"url":"https://github.com/fabricio-p/as-malloc","last_synced_at":"2025-05-15T19:30:57.385Z","repository":{"id":158255515,"uuid":"365748582","full_name":"fabricio-p/as-malloc","owner":"fabricio-p","description":"A memory allocator written for AssemblyScript","archived":false,"fork":false,"pushed_at":"2021-08-11T16:26:18.000Z","size":14,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T00:01:38.469Z","etag":null,"topics":["allocator","assemblyscript","memory","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fabricio-p.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":"2021-05-09T12:34:26.000Z","updated_at":"2024-10-29T02:34:08.000Z","dependencies_parsed_at":"2024-01-20T16:49:20.848Z","dependency_job_id":"23a41340-21a0-4ad0-8ae5-aa04c1aa909f","html_url":"https://github.com/fabricio-p/as-malloc","commit_stats":null,"previous_names":["fabricio-p/as-malloc","fabriciopashaj/as-malloc"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabricio-p%2Fas-malloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabricio-p%2Fas-malloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabricio-p%2Fas-malloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabricio-p%2Fas-malloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabricio-p","download_url":"https://codeload.github.com/fabricio-p/as-malloc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254407242,"owners_count":22066197,"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":["allocator","assemblyscript","memory","wasm","webassembly"],"created_at":"2024-08-04T06:00:33.084Z","updated_at":"2025-05-15T19:30:57.071Z","avatar_url":"https://github.com/fabricio-p.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# as-malloc\nThis library provides a ligtweight implementation of the holy trinity of\ndynamic memory allocation: `malloc`, `realloc`, `free`.\n## Usage\nIf you have never heard of the functions above, you probably lived in a cave.\nYou just import the functions:\n```ts\nimport {malloc, realloc, free} from \"as-malloc\";\n```\nDeclare some unmanaged class (for easier memory access:\n```ts\n@unmanaged\nclass Foo {\n\tbar: i32;\n\tbaz: f64;\n}\n```\nAllocate the memory for that class:\n```ts\nconst foo = changetype\u003cFoo\u003e(malloc(offsetof\u003cFoo\u003e()));\n```\nAnd then do whatever you want with it:\n```ts\nfoo.bar = 35433;\nfoo.baz = 45.89117345;\n```\n## Things to remember\n - as-malloc uses only one page of WebAssembly memory (64kB). This may be\n   changed on the future versions\n - If you are using any managed runtime, you should compile your program with\n   `--memoryBase 65536`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabricio-p%2Fas-malloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabricio-p%2Fas-malloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabricio-p%2Fas-malloc/lists"}