NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Mistakes and cool things to do with arena allocators (zylinski.se)
codr7 1 hours ago [-]
I like composable single feature allocators, a free list is just another kind of allocator that may be plugged in at any point.

https://github.com/codr7/hacktical-c/tree/main/malloc1

https://github.com/codr7/hacktical-c/tree/main/malloc2

o11c 1 hours ago [-]
> You can only deallocate everything in the arena, not individual parts of it.

Untrue; this excludes the middle. GNU Obstack is a widely-used arena allocator with a "free everything allocated after this point" operation, among others.

grandempire 7 minutes ago [-]
This is arguing about the definition of an Arena.

It’s like if I say a stack only has push and pop, and you tell me you can search though and find another element.

tonyedgecombe 1 hours ago [-]
PostScript does something similar with its save and restore operators.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 22:01:33 GMT+0000 (Coordinated Universal Time) with Vercel.