{"id":13639132,"url":"https://github.com/andryblack/TLSF","last_synced_at":"2025-04-19T21:35:42.271Z","repository":{"id":143157724,"uuid":"41568531","full_name":"andryblack/TLSF","owner":"andryblack","description":"tlsf allocator with tests","archived":false,"fork":false,"pushed_at":"2016-05-05T11:13:50.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T01:13:52.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andryblack.png","metadata":{"files":{"readme":"Readme.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-08-28T20:49:55.000Z","updated_at":"2021-02-20T17:42:57.000Z","dependencies_parsed_at":"2024-01-12T20:03:14.922Z","dependency_job_id":null,"html_url":"https://github.com/andryblack/TLSF","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/andryblack%2FTLSF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andryblack%2FTLSF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andryblack%2FTLSF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andryblack%2FTLSF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andryblack","download_url":"https://codeload.github.com/andryblack/TLSF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223810272,"owners_count":17206727,"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":[],"created_at":"2024-08-02T01:00:57.986Z","updated_at":"2024-11-09T09:30:37.522Z","avatar_url":"https://github.com/andryblack.png","language":"C","readme":"Two Level Segregated Fit memory allocator implementation.\r\nWritten by Matthew Conte (matt@baisoku.org).\r\nPublic Domain, no restrictions.\r\n\r\n\thttp://tlsf.baisoku.org\r\n\r\nFeatures\r\n--------\r\n* O(1) cost for malloc, free, realloc, memalign\r\n* Extremely low overhead per allocation (4 bytes)\r\n* Low overhead per TLSF management of pools (~3kB)\r\n* Low fragmentation\r\n* Compiles to only a few kB of code and data\r\n* Support for adding and removing memory pool regions on the fly\r\n\r\nCaveats\r\n-------\r\n* Currently, assumes architecture can make 4-byte aligned accesses\r\n* Not designed to be thread safe; the user must provide this\r\n\r\nNotes\r\n-----\r\nThis code was based on the TLSF 1.4 spec and documentation found at:\r\n\r\n\thttp://rtportal.upv.es/rtmalloc/allocators/tlsf/index.shtml\r\n\r\nIt also leverages the TLSF 2.0 improvement to shrink the per-block overhead\r\nfrom 8 to 4 bytes.\r\n\r\nKnown Issues\r\n------------\r\n* Due to the internal block structure size and the implementation\r\ndetails of tlsf_memalign, there is worst-case behavior when requesting\r\nsmall (\u003c16 byte) blocks aligned to 8-byte boundaries. Overuse of memalign\r\nwill generally increase fragmentation, but this particular case will leave\r\nlots of unusable \"holes\" in the pool. The solution would be to internally\r\nalign all blocks to 8 bytes, but this will require significantl changes\r\nto the implementation. Contact me if you are interested.\r\n\r\nHistory\r\n-------\r\n2014/02/08 - v3.0\r\n   * This version is based on improvements from 3DInteractive GmbH\r\n   * Interface changed to allow more than one memory pool\r\n   * Separated pool handling from control structure (adding, removing, debugging)\r\n   * Control structure and pools can still be constructed in the same memory block\r\n   * Memory blocks for control structure and pools are checked for alignment\r\n   * Added functions to retrieve control structure size, alignment size, min and\r\n     max block size, overhead of pool structure, and overhead of a single allocation\r\n   * Minimal Pool size is tlsf_block_size_min() + tlsf_pool_overhead()\r\n   * Pool must be empty when it is removed, in order to allow O(1) removal\r\n\r\n2011/10/20 - v2.0\r\n   * 64-bit support\r\n   * More compiler intrinsics for ffs/fls\r\n   * ffs/fls verification during TLSF creation in debug builds\r\n\r\n2008/04/04 - v1.9\r\n   * Add tlsf_heap_check, a heap integrity check\r\n   * Support a predefined tlsf_assert macro\r\n   * Fix realloc case where block should shrink; if adjacent block is\r\n     in use, execution would go down the slow path\r\n\r\n2007/02/08 - v1.8\r\n   * Fix for unnecessary reallocation in tlsf_realloc\r\n\r\n2007/02/03 - v1.7\r\n   * tlsf_heap_walk takes a callback\r\n   * tlsf_realloc now returns NULL on failure\r\n   * tlsf_memalign optimization for 4-byte alignment\r\n   * Usage of size_t where appropriate\r\n\r\n2006/11/21 - v1.6\r\n   * ffs/fls broken out into tlsfbits.h\r\n   * tlsf_overhead queries per-pool overhead\r\n\r\n2006/11/07 - v1.5\r\n   * Smart realloc implementation\r\n   * Smart memalign implementation\r\n\r\n2006/10/11 - v1.4\r\n   * Add some ffs/fls implementations\r\n   * Minor code footprint reduction\r\n\r\n2006/09/14 - v1.3\r\n   * Profiling indicates heavy use of blocks of\r\n     size 1-128, so implement small block handling\r\n   * Reduce pool overhead by about 1kb\r\n   * Reduce minimum block size from 32 to 12 bytes\r\n   * Realloc bug fix\r\n\r\n2006/09/09 - v1.2\r\n   * Add tlsf_block_size\r\n   * Static assertion mechanism for invariants\r\n   * Minor bugfixes \r\n\r\n2006/09/01 - v1.1\r\n   * Add tlsf_realloc\r\n   * Add tlsf_walk_heap\r\n\r\n2006/08/25 - v1.0\r\n   * First release\r\n","funding_links":[],"categories":["malloc/free Implementations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandryblack%2FTLSF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandryblack%2FTLSF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandryblack%2FTLSF/lists"}