{"id":24152439,"url":"https://github.com/kamilkrauze/stackvector","last_synced_at":"2025-10-14T11:44:08.166Z","repository":{"id":215806527,"uuid":"739823297","full_name":"KamilKrauze/StackVector","owner":"KamilKrauze","description":"A cache-coherent stack allocated templated vector.","archived":false,"fork":false,"pushed_at":"2024-01-20T18:16:35.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-12T00:43:59.079Z","etag":null,"topics":["cache-coherence","cmake","cpp","data-structures"],"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/KamilKrauze.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2024-01-06T16:50:03.000Z","updated_at":"2024-01-19T15:18:22.000Z","dependencies_parsed_at":"2025-07-25T22:04:22.405Z","dependency_job_id":null,"html_url":"https://github.com/KamilKrauze/StackVector","commit_stats":null,"previous_names":["kamilkrauze/stackvector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KamilKrauze/StackVector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamilKrauze%2FStackVector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamilKrauze%2FStackVector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamilKrauze%2FStackVector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamilKrauze%2FStackVector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KamilKrauze","download_url":"https://codeload.github.com/KamilKrauze/StackVector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamilKrauze%2FStackVector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019074,"owners_count":26086518,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cache-coherence","cmake","cpp","data-structures"],"created_at":"2025-01-12T10:16:04.300Z","updated_at":"2025-10-14T11:44:08.123Z","avatar_url":"https://github.com/KamilKrauze.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack Allocated Vector\n\u003e Visit the [wiki](https://github.com/KamilKrauze/StackVector/wiki) for more information\n\n## Description\nThis is a header only library, so you can just download the header file and include it in your project (with the LICENSE naturally).\nA very similar and easy replacement where required of \u003cb\u003e``std::vector\u003cclass T\u003e``\u003c/b\u003e data structure, the key difference being the data is dynicamically allocated on the stack, resulting in being cache-coherent.\n\nNormally, for general use-cases dynamic stack allocation should be avoided as it may result code being unsafe and/or unstable due to the nature of dynamic stack allocation and other methods should be sought after.\n\nHowever, some circumstances may call for dynamic stack allocation and can be seen in areas where speed of execution is important such as real-time 3D renderers, raytracres, patch tracers or game engines, as some parts in memory may be read and written to multiple times and if it were allocated on the heap the time taken would be a lot longer comparitively to stack allocated memory.\n\nI wouldn't say this is the best solution out there, but this is my approach to it. The implementation is similar to that of the `std::vector` implementation, so it should be a general drop-in replace.\n\n## Usage\n1. If you want to use this library in your code then just include the `stack_vector.hpp` file located at `~/StackVector/include/`\n2. To run tests go to the [Project Setup](#project-setup) section.\n\n## Project Setup\n\u003e $${\\color{yellow}You \\space may \\space use \\space CMake \\space or \\space Premake \\space to \\space generate \\space your \\space project. }$$\n\n### CMake\nIf you want to run the tests for yourself, download [CMake](https://cmake.org/) to your respective platform and then generate necessary project files.\nYou may use the CMake GUI if you find it easier over using the CLI. Just do `configure` then `generate`\n\nOtherwise use the CLI at the project working directory like so:\n\n\u003e #### Configure\n\u003e \u003e Windows\n\u003e \u003e ```bat\n\u003e \u003e cd build; cmake -G \"Visual Studio 17 2022\" ..; cd ..\n\u003e \u003e ```\n\u003e\n\u003e \u003e Linux\n\u003e \u003e ```bash\n\u003e \u003e cd build; cmake -G \"Unix Makefiles\" ..; cd ..\n\u003e \u003e ```\n\u003e\n\u003e #### Build\n\u003e \u003e Debug\n\u003e \u003e ```bat\n\u003e \u003e cmake --build . --config Debug\n\u003e \u003e ```\n\u003e\n\u003e \u003e Release\n\u003e \u003e ```bash\n\u003e \u003e cmake --build . --config Release\n\u003e \u003e ```\n\u003e \u003cbr\u003e\n\n### Premake\nIf you want to run the tests for yourself, download [Premake5](https://premake.github.io/) to your respective platform and then generate necessary project files.\nThis is platform dependent so here is a quick guide:\n\u003e Windows\n\u003e ```bat\n\u003e ./premake5 vs2022\n\u003e ```\n\n\u003e Linux\n\u003e ```bash\n\u003e ./premake5 gmake2\n\u003e ```\n\n\u003e MacOS\n\u003e \n\u003e I don't own a Mac and have never programmed on Mac, so fend for yourselves.\n\nMore information can be found [here](https://premake.github.io/docs/Using-Premake/#using-premake-to-generate-project-files).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamilkrauze%2Fstackvector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamilkrauze%2Fstackvector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamilkrauze%2Fstackvector/lists"}