<s>
In	O
the	O
C	B-Language
programming	I-Language
language	I-Language
,	O
Obstack	B-Application
is	O
a	O
memory-management	O
GNU	O
extension	O
to	O
the	B-Language
C	I-Language
standard	I-Language
library	I-Language
.	O
</s>
<s>
An	O
"	O
obstack	B-Application
"	O
is	O
a	O
"	B-Application
stack	I-Application
"	I-Application
of	O
"	O
objects	O
"	O
(	O
data	O
items	O
)	O
which	O
is	O
dynamically	O
managed	O
.	O
</s>
<s>
It	O
implements	O
a	O
region-based	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
scheme	O
.	O
</s>
<s>
Obstack	B-Application
code	O
typically	O
provides	O
C	B-Language
macros	O
which	O
take	O
care	O
of	O
memory	B-General_Concept
allocation	I-General_Concept
and	O
management	O
for	O
the	O
user	O
.	O
</s>
<s>
Basically	O
,	O
obstacks	B-Application
are	O
used	O
as	O
a	O
form	O
of	O
memory	B-General_Concept
management	I-General_Concept
which	O
can	O
be	O
more	O
efficient	O
and	O
less	O
difficult	O
to	O
implement	O
than	O
malloc/free	O
in	O
several	O
situations	O
.	O
</s>
<s>
For	O
example	O
,	O
say	O
one	O
needs	O
to	O
set	O
up	O
a	O
stack	B-Application
for	O
handling	O
data	O
items	O
whose	O
number	O
grows	O
for	O
a	O
while	O
and	O
then	O
reach	O
a	O
final	O
form	O
;	O
such	O
a	O
stack	B-Application
could	O
be	O
defined	O
in	O
obstack.h.	O
</s>
<s>
Once	O
the	O
object	O
is	O
allocated	O
a	O
new	O
chunk	O
of	O
memory	O
in	O
obstack	B-Application
it	O
must	O
be	O
freed	O
after	O
its	O
use	O
.	O
</s>
<s>
The	O
interfaces	O
for	O
using	O
obstacks	B-Application
may	O
be	O
defined	O
either	O
as	O
functions	B-Language
or	O
as	O
macros	O
,	O
depending	O
on	O
the	O
compiler	B-Language
.	O
</s>
<s>
The	O
obstack	B-Application
facility	O
works	O
with	O
all	O
C	B-Language
compilers	B-Language
.	O
</s>
<s>
In	O
an	O
old-fashioned	O
non-ISO	O
C	B-Language
compiler	B-Language
,	O
all	O
the	O
obstack	B-Application
functions	B-Language
are	O
actually	O
defined	O
only	O
as	O
macros	O
.	O
</s>
<s>
You	O
can	O
call	O
these	O
macros	O
like	O
functions	B-Language
,	O
but	O
you	O
cannot	O
use	O
them	O
in	O
any	O
other	O
way	O
.	O
</s>
<s>
Calling	O
the	O
macros	O
requires	O
a	O
special	O
precaution	O
:	O
namely	O
,	O
the	O
first	O
operand	O
(	O
the	O
obstack	B-Application
pointer	O
)	O
should	O
not	O
contain	O
any	O
side	O
effects	O
,	O
because	O
it	O
may	O
be	O
computed	O
more	O
than	O
once	O
.	O
</s>
<s>
In	O
ISO	O
C	B-Language
,	O
each	O
obstack	B-Application
function	O
has	O
both	O
a	O
macro	O
definition	O
and	O
a	O
function	O
definition	O
.	O
</s>
<s>
This	O
is	O
the	O
same	O
situation	O
that	O
exists	O
in	O
ISO	O
C	B-Language
for	O
the	O
standard	B-Language
library	I-Language
functions	I-Language
.	O
</s>
<s>
Since	O
the	O
memory	O
chunks	O
in	O
an	O
obstack	B-Application
are	O
used	O
sequentially	O
,	O
it	O
is	O
possible	O
to	O
build	O
up	O
an	O
object	O
by	O
adding	O
data	O
of	O
size	O
'	O
bytes	O
 '	O
at	O
the	O
end	O
of	O
it	O
.	O
</s>
