On Sun, 04 Jul 2010 02:45:37 -0400
Jose Gonzalez <jose_...@juno.com> wrote:

> 
>    Brett Nash wrote:
> 
> > ............
> > Until then, I'm going to continue to put people checking the alloca
> > return value in the category of "doesn't know what alloca does, and
> > unable to read documentation".
> >
> >   
>    People can make oversights now and then, even change their code
> from a malloc to an alloca and forget they've done so, etc. How can
> you be so certain why they're checking for the return value.

I actually agree.  The reason I made (what I thought was) a humorous
comment in a commit, and NOT raised on it on the mailing list was
because I'm aware of such things.

The code in question has been modified multiple times by multiple
people.  I'm not even sure who did what, as the commit history for the
code is rather complex (beyond my svn fu).  I attempted to find the
person who I had thought created the code privately, but he rightly
pointed out it wasn't him.

My commit message reads:
  Don't check alloca, it's like checking the stack exists.

Strangely however somebody (not yourself) would rather quote
non-existent standards at me and make personal insults on a mailing list
rather then actually check the code committed, which removed various
bad uses of alloca, including following (heavily edited for clarity):

    unicode_out = (FriBidiChar *)alloca(sizeof(FriBidiChar) * (len + 1));
...
 /* ERROR HANDLING */
-error6:
-   free(unicode_out);


>    In any case, you may want to bring this discussion up with the
> author of:
> evas/src/lib/engines/common/evas_map_image_internal.c
> 
> where around line 78 you'll find some code that reads:

Strangely... I did.

In fact he was about 1m away when I made the commit, and I
specifically mentioned it to him at the time.

Just to be clear, this was not part of some 'remove all alloca return
checks' crusade:  In this case I looked at the function (trying to trace
down what was triggering another bug) and saw the check for alloca. This
made me suspicious so I checked the whole function, and found the free
on the alloca return.  Which I fixed.

If anyone is really bothered by the fact that turboc or some other
obscure platform can return null, they are welcome to fix it.
Otherwise I don't believe I have anything else to say on the issue.

        Regards,
        nash


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to