{"id":13712959,"url":"https://github.com/DutchGhost/maybeuninit","last_synced_at":"2025-05-06T22:31:55.634Z","repository":{"id":45907123,"uuid":"201669872","full_name":"DutchGhost/maybeuninit","owner":"DutchGhost","description":"MaybeUninit in Zig.","archived":false,"fork":false,"pushed_at":"2020-09-30T19:13:21.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T13:47:49.384Z","etag":null,"topics":["maybeuninit","zig"],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DutchGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-10T18:43:02.000Z","updated_at":"2022-07-17T17:09:16.000Z","dependencies_parsed_at":"2022-08-28T17:02:22.550Z","dependency_job_id":null,"html_url":"https://github.com/DutchGhost/maybeuninit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchGhost%2Fmaybeuninit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchGhost%2Fmaybeuninit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchGhost%2Fmaybeuninit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DutchGhost%2Fmaybeuninit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DutchGhost","download_url":"https://codeload.github.com/DutchGhost/maybeuninit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779222,"owners_count":21802905,"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":["maybeuninit","zig"],"created_at":"2024-08-02T23:01:25.181Z","updated_at":"2025-05-06T22:31:50.558Z","avatar_url":"https://github.com/DutchGhost.png","language":"Zig","readme":"# maybeuninit\n[![License:EUPL](https://img.shields.io/badge/License-EUPLv.1.2-brightgreen.svg)](https://opensource.org/licenses/EUPL-1.2)\n![Zig](https://github.com/DutchGhost/maybeuninit/workflows/Zig/badge.svg?branch=master)\n\nThis is a userlevel implementation of the `undefined` keyword in Zig.\u003cbr\u003e\nIt is inspired by [MaybeUninit](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html) in Rust.\n  \n## Minimum supported `Zig`\n`master`\n\nEach day will be tested in CI whether this project still builds on Zig master.\n\n## Recent changes\n  * 0.6.1\n    * Add `withByte` as initializer function.\n    * Remove all use of `inline`, as the usage of `inline` was considered wrong.\n  * 0.6\n    * Rename `assume_init` to `assumeInit`.\n    * rename `as_ptr` and `as_mut_ptr` to `asPtr` and `asMutPtr`.\n    * rename `first_ptr` and `first_ptr_mut` to `firstPtr` and `firstPtrMut`.\n  * 0.5.2\n    * Only support Zig's Master branch.\n  * 0.5.1\n    * Add a private constant uninit intializer, to get around https://github.com/ziglang/zig/issues/3994.\n  * 0.5\n    * Do not call `@memset` in `MaybeUninit(T).zeroed()` if `T` has a size of 0.\n  * 0.4\n    * Prevent `MaybeUninit(noreturn)` from being created. See https://github.com/ziglang/zig/issues/3603.\n  * 0.3\n    * Change the return type of `first_ptr_mut` from `*Self` to `*T`.\n    * Adds a test that calls `first_ptr_mut` on an empty slice.\n  * 0.2\n    * Change the definition of `MaybeUninit` from `packed union` to `extern union`, due to `packed union`'s setting the alignment always to 1.\n  * 0.1\n    * Initial library setup.\n\n## Issues\nAt the point of writing, it is impossible to create an uninitialized `MaybeUninit(T)`, and later initialize it at compiletime.\u003cbr\u003e\nThis is an issue of the compiler, which tracks the current active field of packed and extern unions when used at compiletime, while it shouldn't.\u003cbr\u003e\nThe issue is reported to the Zig compiler, and can be followed [here](https://github.com/ziglang/zig/issues/3134).\n","funding_links":[],"categories":["Misc libraries","Language Essentials"],"sub_categories":["Memory Allocator and Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDutchGhost%2Fmaybeuninit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDutchGhost%2Fmaybeuninit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDutchGhost%2Fmaybeuninit/lists"}