TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Understanding the heap – a beautiful mess

107 pointsby jiceaover 1 year ago

2 comments

wavemodeover 1 year ago
Site seems hugged to death<p>archive: <a href="http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20231129055356&#x2F;https:&#x2F;&#x2F;jackfromeast.site&#x2F;2023-01&#x2F;understand-the-heap-a-beautiful-mess.html" rel="nofollow noreferrer">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20231129055356&#x2F;https:&#x2F;&#x2F;jackfromea...</a>
turtledragonflyover 1 year ago
Not so much the author&#x27;s fault, but there&#x27;s a bit of confusing terminology around the meaning of &quot;pool&quot; in memory allocator literature in general, and this article in particular.<p>In this article, they say:<p>&gt; Pools ... involve: pre-allocating ... core resources that are frequently used in a program, which are self-managed by the program ...<p>This (IME) most often means some sort of &quot;object pool,&quot; with fixed-size objects and O(1) allocation and de-allocation.<p>And also:<p>&gt; a memory pool pre-allocates a large block of memory ... When the programmer releases the memory, it is returned to the pool ... and is merged with surrounding free memory blocks as much as possible.<p>This clearly is <i>not</i> referring to the object pool concept. In the article, the O(1) freelist approach falls under the &quot;bins&quot; nomenclature.<p>In general, memory allocator terminology is pretty messy, varying between sources and implementations. Words like &quot;arena allocator&quot; and &quot;stack allocator&quot; seem frequently abused&#x2F;blurred, made worse by the fact that one can nest allocators in each other — eg: a stack allocator which allocates from an arena, but sometimes referred to one or the other interchangeably.<p>I had a bit of a rollercoaster ride trying to make heads and tails of it all when I was researching these things.
评论 #38472804 未加载