{"id":15047802,"url":"https://github.com/massimo-marino/object-pool","last_synced_at":"2025-06-24T10:09:31.567Z","repository":{"id":162666681,"uuid":"104228677","full_name":"massimo-marino/object-pool","owner":"massimo-marino","description":"C++ implementation of an object pool pattern","archived":false,"fork":false,"pushed_at":"2024-05-20T14:27:20.000Z","size":56,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T01:44:40.018Z","etag":null,"topics":["allocation","cpp","cpp14","cpp17","cpp20","object-factory","object-pool","object-storage","pool","pool-pattern"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/massimo-marino.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-09-20T14:48:22.000Z","updated_at":"2025-02-21T20:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"b240a304-dc8d-4ac1-8357-46ef9eedda73","html_url":"https://github.com/massimo-marino/object-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/massimo-marino/object-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Fobject-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Fobject-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Fobject-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Fobject-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/massimo-marino","download_url":"https://codeload.github.com/massimo-marino/object-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Fobject-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261649856,"owners_count":23189754,"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":["allocation","cpp","cpp14","cpp17","cpp20","object-factory","object-pool","object-storage","pool","pool-pattern"],"created_at":"2024-09-24T21:04:51.621Z","updated_at":"2025-06-24T10:09:31.542Z","avatar_url":"https://github.com/massimo-marino.png","language":"C++","readme":"# object-pool\nC++17 implementation of an object pool pattern\n\n#### Description\n\n\n This code is a fork \u0026 extension from the following code:\n\n  http://media.wiley.com/product_ancillary/50/11188580/DOWNLOAD/c25_code.zip\n\n From the original source file:\n \n**--- cit ON**\n\n*Provides an object pool that can be used with any class that provides a default constructor.*\n\n*The object pool constructor creates a pool of objects, which it hands out\nto clients when requested via the acquireObject() method. acquireObject()\nreturns an Object which is a std::shared_ptr with a custom deleter that\nautomatically puts the object back into the object pool when the shared_ptr\nis destroyed and its reference reaches 0.*\n\n*The constructor and destructor on each object in the pool will be called only\nonce each for the lifetime of the program, not once per acquisition and release.*\n\n*The primary use of an object pool is to avoid creating and deleting objects\nrepeatedly. The object pool is most suited to applications that use large \nnumbers of objects with expensive constructors for short periods of time, if\na profiler tells you that allocating and deallocating these objects is a\nbottleneck.*\n\n**--- cit OFF**\n\n\nIt is also possible to create an object pool providing a non-default ctor for\nthe objects that are registered and used at any new allocation when the pool\nis empty\n\n\nObjects returned to the pool are reset by default.\n\n\nSee: https://en.wikipedia.org/wiki/Object_pool_pattern\n\n\nSee the unit tests for examples of use.\n\n\n#### Requirements\n\n`cmake` is used to compile the sources.\n\nThe default compiler used is `clang++`.\n\nThe cmake files compile with `-std=c++20`.\n\nThe unit tests are implemented in `googletest`: be sure you have installed `googletest` to compile.\n\n\n#### Install\n\n```bash\n$ git clone https://github.com/massimo-marino/object-pool.git\n$ cd object-pool\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n```\n\n#### Run Unit Tests\n\nUnit tests are implemented with `googletest`.\n\nInstall `googletest` to compile and run them.\n\n\n```bash\n$ cd src/unitTests\n$ ./unitTests\n```\n\n\n#### Run Example [==Not Yet Implemented==]\n\n```bash\n$ cd ../example\n$ ./object-pool-example\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-marino%2Fobject-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmassimo-marino%2Fobject-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-marino%2Fobject-pool/lists"}