Built something? We create video reels & spotlights for GitHub projects.Promote your project →
Catalog / demonlife / bpa
Public GitHub Catalog Discovered Sep 29, 2026

demonlife / bpa

A bump pointer allocator - 这个库可以管理你指定的内存块,切割内存使用。所有内存块都用 id 索引,id 不会复用(在 32bit 用完前),所以你可以方便的知道一个 id 已经无效,这相当于支持了弱引用。从 id 映射到地址的操作是 O(1) 的,非常廉价,在显式执行整理操作前,内存不会移动。 内存分配也是 O(1) 的,只在少数情况下会退化成 O(n) 。释放操作只是减引用,也是 O(1) 的。内存整理工作可以定帧调用,虽然它需要 stop the world ,但可以保证在固定时间做完至少一步(除非有单个内存块特别大)。 内存块支持引用计数,由于有弱引用支持,所以使用者可以比较容易的回避循环引用的问题。 它还有许多改进空间:例如支持多线程;支持某些块禁止移动,方便外部保有指针。

View repository on GitHub ↗ View creator profile Browse directory

About this discovery

This repository is cataloged as part of our automated global GitHub synchronization. Full telemetry, velocity snapshots, and code summaries are scheduled for continuous enrichment.

#14766317GitHub System ID
demonlifeOrganization / User
PublicVisibility
ActiveCatalog Status

More from demonlife

↗

demonlife/cppitertools

Implementation of python itertools and builtin iteration functions for C++11

Discovered
FOR MAINTAINERS

Built something? Put it in front of millions of developers.

We make a short reel about your project and post it across YouTube, Instagram, Threads, and X. Send a link, we do the rest.