Obstack
From Wikipedia, the free encyclopedia
In the C programming language, Obstack is a memory-management GNU extension to the C standard library.[1] An "obstack" is a "stack" of "objects" (data items) which is dynamically managed.[2] It implements a region-based memory management scheme.
![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
|
Obstack code typically provides C macros which take care of memory allocation and management for the user. Basically, obstacks are used as a form of memory management which can be more efficient and less difficult to implement than malloc/free in several situations. For example, say one needs to set up a stack for handling data items whose number grows for a while and then reach a final form; such a stack could be defined in obstack.h.