Type Safe Generic Data Structures in C (2025)

·Hacker News··

See my follow-up article: “A Fast, Growable Array With Stable Pointers in C” I write type safe generic data structures in C using a technique that I haven’t seen elsewhere1. It uses unions to associate type information with a generic data structure, but we’ll get to that. My approach works for any type of data structure: maps, arrays, binary trees… but for this article I illustrate the ideas by implementing a basic linked list.

Read full article →

Related Articles

Why there are still no non-WebKit browsers on iOS
lapcat · Hacker News · 9h ago
OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-121481, CVSS 9.8)
JacobHenner · Hacker News · 22h ago
Unauthenticated remote code execution in Nginx
speedping · Hacker News · 2d ago
GIMP now has UI tests
qtqtqt · Hacker News · 20h ago
Pancreatic cancer halted by virus injection in three patients
cybermango · Hacker News · 1d ago