TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Any good resource on writing your own mmap allocator?

6 点作者 cplat超过 6 年前
I&#x27;ve been experimenting with using mmapped files as storage. One thing that I&#x27;m trying out is writing variable sized records to an mmapped file. However, I&#x27;ll also be supporting deletions and updates, so fragmentation can become a big problem. Moreover, there could be records written at different times that need to be physically &quot;colocated&quot; for efficiency.<p>My question is, are there good resources to get started on working on on-disk allocators? I don&#x27;t want to get there in a day, but need a solid direction. Thanks!

1 comment

rain1超过 6 年前
I collected some links to interesting and useful links about allocators here <a href="https:&#x2F;&#x2F;github.com&#x2F;rain-1&#x2F;awesome-allocators" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rain-1&#x2F;awesome-allocators</a><p>I think you would look into bitmap based allocators (which only handles fixed size allocations, but it&#x27;s very simple) and then (more advanced) binary buddies system to start with.<p>* <a href="http:&#x2F;&#x2F;sean.cm&#x2F;a&#x2F;tricolor-garbage-collector" rel="nofollow">http:&#x2F;&#x2F;sean.cm&#x2F;a&#x2F;tricolor-garbage-collector</a><p>* <a href="http:&#x2F;&#x2F;www.memorymanagement.org&#x2F;mmref&#x2F;alloc.html" rel="nofollow">http:&#x2F;&#x2F;www.memorymanagement.org&#x2F;mmref&#x2F;alloc.html</a>
评论 #18258058 未加载