{"id":21699872,"url":"https://github.com/jonasraoni/memory-block","last_synced_at":"2025-03-20T15:41:54.335Z","repository":{"id":124279249,"uuid":"107907779","full_name":"jonasraoni/memory-block","owner":"jonasraoni","description":"A set of simple functions to manage the memory of a dynamic array with fixed size items and contiguous memory.","archived":false,"fork":false,"pushed_at":"2017-10-22T22:28:45.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T14:43:11.270Z","etag":null,"topics":["array","block","c","dynamic","dynamic-array","list","memory","memory-management"],"latest_commit_sha":null,"homepage":null,"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/jonasraoni.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}},"created_at":"2017-10-22T22:27:21.000Z","updated_at":"2017-10-22T22:29:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"09828baf-3346-41ee-8e90-081426de4b2e","html_url":"https://github.com/jonasraoni/memory-block","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fmemory-block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fmemory-block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fmemory-block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasraoni%2Fmemory-block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasraoni","download_url":"https://codeload.github.com/jonasraoni/memory-block/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244644319,"owners_count":20486780,"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":["array","block","c","dynamic","dynamic-array","list","memory","memory-management"],"created_at":"2024-11-25T20:11:52.280Z","updated_at":"2025-03-20T15:41:54.313Z","avatar_url":"https://github.com/jonasraoni.png","language":"C","readme":"# Memory Block\n\nA set of simple functions to manage the memory of a dynamic array with fixed size items and contiguous memory.\n\nThe MemoryBlock structure contains 4 elements:  \ndata: pointer to the real data  \ncapacity: storage capacity  \nsize: data size of each item\n\nThe block grows according to the current capacity, when capacity is:  \n\u0026gt; 64: allocate extra space for \"capacity / 4\" items  \n\u0026gt; 8: allocate extra space for 16 items  \n\u0026lt; 9: allocate extra space for 4 items\n\nBeing a dynamic block of memory, do not hold pointers to its internal data for too long as it may be reallocated to another address whenever there's not enough contiguous memory to grow.\n\n## How to use\n\nThe header [memory-block.h](memory-block.h) contains the documentation.\n\nAlso check the file [test.c](test.c), it contains some examples and expectations. To compile the test:  \n- gcc: \u003ccode\u003egcc -lm memory-block.c test.c -o test\u003c/code\u003e  \n- g++: \u003ccode\u003eg++ memory-block.c test.c -o test\u003c/code\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasraoni%2Fmemory-block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasraoni%2Fmemory-block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasraoni%2Fmemory-block/lists"}