- Subject: Re: [slang-users] Which Way is better?
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Tue, 3 May 2005 12:13:20 -0400
Ben Duncan <ben@xxxxxxxxxxxxxxxxxx> wrote:
>In latter work, I have started using "push" and "pop" functions, because It
>seemed more convenient and flexible.
>
>Question is, which way is more effective and quicker? John, which way would
>you do it ?
I use both techniques. Keep in mind that if you use "push" and "pop",
then you are also responsible for freeing any memory associated with
the objects, For examples, if instead of
void some_function (char *foo)
{
.
.
you use
void some_function (void)
{
char *foo;
if (-1 == SLang_pop_slstring (&foo))
return;
.
.
then you must also make a call to SLang_free_slstring to free the
memory associated with foo.
--John
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2005 date index]
[2005 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]