Skip to content

Comment on How to Make a Computer Operating System in C/C++parent

Comments

The rest of the data structures in the STL follow the same (anti-)pattern.

They all either take ownership of your data, or point at your data unidirectionally.

This means that given a pointer to your data you cannot, for example, delete it from multiple data structures it is contained within without going from these structures roots to re-find the pointers to your data.

Whereas with intrusive data structures (the way it is done in the Linux kernel and other "advanced" C projects), you can easily embed your structure in multiple data structures, such that you can do very quick deletion or modification of the data without re-finding it.

I think Boost has something like this.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.