{"id":13711133,"url":"https://github.com/jiacai2050/zig-jemalloc","last_synced_at":"2025-04-10T06:50:33.881Z","repository":{"id":231346187,"uuid":"781276886","full_name":"jiacai2050/zig-jemalloc","owner":"jiacai2050","description":"Zig allocator baked by jemalloc","archived":false,"fork":false,"pushed_at":"2024-10-27T11:26:01.000Z","size":900,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T07:53:04.496Z","etag":null,"topics":["zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiacai2050.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-03T04:37:38.000Z","updated_at":"2024-10-31T18:26:16.000Z","dependencies_parsed_at":"2024-10-27T12:32:04.496Z","dependency_job_id":"afab2694-b154-4bb1-a71c-1d0bb91c5cfb","html_url":"https://github.com/jiacai2050/zig-jemalloc","commit_stats":null,"previous_names":["jiacai2050/zig-jemalloc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fzig-jemalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fzig-jemalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fzig-jemalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fzig-jemalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiacai2050","download_url":"https://codeload.github.com/jiacai2050/zig-jemalloc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173852,"owners_count":21059595,"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":["zig-library","zig-package"],"created_at":"2024-08-02T23:01:04.843Z","updated_at":"2025-04-10T06:50:33.857Z","avatar_url":"https://github.com/jiacai2050.png","language":"C","funding_links":[],"categories":["Interoperability"],"sub_categories":["FFI Bindings"],"readme":"#+TITLE: zig-jemalloc\n#+DATE: 2024-04-03T16:31:20+0800\n#+LASTMOD: 2024-10-16T08:45:54+0800\n#+AUTHOR: Jiacai Liu\n\n[[https://github.com/jiacai2050/zig-jemalloc/actions/workflows/CI.yml][https://github.com/jiacai2050/zig-jemalloc/actions/workflows/CI.yml/badge.svg]]\n[[https://img.shields.io/badge/zig%20version-0.13.0-blue.svg]]\n[[https://img.shields.io/badge/zig%20version-master-blue.svg]]\n\nZig allocator backed by [[https://jemalloc.net/][jemalloc]].\n\n* Usage\n#+begin_src shell\nzig fetch --save=jemalloc https://github.com/jiacai2050/zig-jemalloc/archive/${COMMIT}.tar.gz\n#+end_src\n\nReplace ~${COMMIT}~ with a real one, then in your =build.zig=, import the module like this:\n#+begin_src zig\nconst dep_jemalloc = b.dependency(\"jemalloc\", .{});\nexe.root_module.addImport(\"jemalloc\", dep_jemalloc.module(\"jemalloc\"));\nexe.linkLibC();\n#+end_src\n\nThis library will link to vendored [[https://github.com/jemalloc/jemalloc/releases/tag/5.3.0][jemalloc(5.3.0)]] by default, you can disable this feature and link to the system-wide version using:\n#+begin_src zig\nconst dep_jemalloc = b.dependency(\"jemalloc\", .{ .link_vendor = false });\n// Install jemalloc with system package manager, such as\n// brew install jemalloc\n// sudo apt-get install libjemalloc-dev\nexe.linkSystemLibrary(\"jemalloc\");\nexe.linkLibC();\n#+end_src\n\nThen in you =main.zig=, initialize like this:\n\n#+begin_src zig\nconst jemalloc = @import(\"jemalloc\");\nconst allocator = jemalloc.allocator;\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fzig-jemalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiacai2050%2Fzig-jemalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fzig-jemalloc/lists"}