<s>
Cleanup	B-Language
Stack	I-Language
is	O
a	O
concept	O
widely	O
used	O
in	O
Symbian	B-Operating_System
OS	I-Operating_System
.	O
</s>
<s>
It	O
is	O
most	O
suitable	O
to	O
use	O
in	O
places	O
where	O
dynamic	B-General_Concept
memory	I-General_Concept
is	O
used	O
(	O
allocated	O
)	O
in	O
programming	O
.	O
</s>
<s>
The	O
problem	O
with	O
dynamic	B-General_Concept
memory	I-General_Concept
is	O
the	O
sole	O
discretion	O
of	O
the	O
underlying	O
OS	O
whether	O
the	O
request	O
for	O
memory	B-General_Concept
allocation	I-General_Concept
shall	O
succeed	O
or	O
not	O
.	O
</s>
<s>
In	O
large	O
programs	O
dynamic	B-General_Concept
memory	I-General_Concept
is	O
used	O
almost	O
everywhere	O
.	O
</s>
<s>
If	O
an	O
application	B-Application
frequently	O
adds	O
the	O
code	O
to	O
handle	O
this	O
failure	O
then	O
it	O
will	O
increase	O
the	O
code	O
size	O
significantly	O
.	O
</s>
<s>
Symbian	B-Operating_System
is	O
used	O
mostly	O
on	O
phones	O
where	O
this	O
increase	O
in	O
the	O
code	O
size	O
will	O
further	O
amplify	O
the	O
memory	B-General_Concept
allocation	I-General_Concept
failures	O
.	O
</s>
<s>
Symbian	B-Operating_System
features	O
an	O
ingenious	O
solution	O
to	O
that	O
problem	O
.	O
</s>
<s>
When	O
an	O
application	B-Application
notes	O
a	O
memory	B-General_Concept
allocation	I-General_Concept
may	O
fail	O
,	O
it	O
places	O
the	O
earlier	O
allocated	O
memory	O
address	O
to	O
a	O
location	O
which	O
Symbian	B-Operating_System
is	O
aware	O
of	O
.	O
</s>
<s>
That	O
location	O
is	O
called	O
Cleanup	B-Language
Stack	I-Language
.	O
</s>
<s>
In	O
the	O
event	O
of	O
failure	O
,	O
Symbian	B-Operating_System
knows	O
that	O
whatever	O
resource	O
is	O
placed	O
on	O
the	O
Cleanup	B-Language
Stack	I-Language
needs	O
be	O
freed	O
.	O
</s>
<s>
This	O
freeing	O
is	O
performed	O
automatically	O
by	O
the	O
Symbian	B-Operating_System
OS	I-Operating_System
.	O
</s>
<s>
Cleanup	B-Language
stack	I-Language
make	O
an	O
idea	O
to	O
keep	O
a	O
copy	O
of	O
pointer	O
to	O
allocated	O
memory	O
and	O
all	O
elements	O
from	O
the	O
cleanup	B-Language
stack	I-Language
are	O
popped	O
out	O
and	O
destroyed	O
by	O
using	O
Push( )	O
,	O
Pop( )	O
,	O
and	O
PopAndDestroy( )	O
.	O
</s>
