1. allocate_string() question

This is a multi-part message in MIME format.

------=_NextPart_000_0063_01C0D577.B8291AE0
	charset="iso-8859-2"

When using allocate_string() as a paramter, is it freed automatically =
after the routine is called? So

atom str
str =3D allocate_string("string")
call_something(str)
free(str)

is same as :

call_something(allocate_string("string"))
-- automatically freed ?


------=_NextPart_000_0063_01C0D577.B8291AE0
Content-Type: text/html;
	charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-2" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Arial CE" size=3D2>When using allocate_string() as a =
paramter, is=20
it freed automatically after the routine is called? So</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>atom str</FONT></DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>str =3D =
allocate_string("string")</FONT></DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>call_something(str)</FONT></DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>free(str)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>is same as :</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Arial CE"=20
size=3D2>call_something(allocate_string("string"))</FONT></DIV>
<DIV><FONT face=3D"Arial CE" size=3D2>-- automatically freed =
?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Arial CE"=20

------=_NextPart_000_0063_01C0D577.B8291AE0--

new topic     » topic index » view message » categorize

2. Re: allocate_string() question

Martin Stachon wrote:

> When using allocate_string() as a paramter, is 
> it freed automatically after the routine is called?

No, you have to free it manually.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu