RE: [xml] too many mallocs?



In message <FC169E059D1A0442A04C40F86D9BA7600C6130 itdomain003 itdomain net au>
          "Robert Collins" <robert collins itdomain com au> wrote:



-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Tuesday, May 21, 2002 4:38 PM

  Well some people suggested dropping xmlMalloc/xmlFree
to use alloca() in some context where the result is discarded
anyway, but I'm not too fond of this.

alloca is much more efficient on most platforms, as it allocs out of the
stack, saving heap free list manipulation/searching.

What hesitations do you have about alloca?

On some systems where alloca allocates out of the stack this may cause
problems where there is only 8k of stack space available to the system.
Obviously this would be highly dependant on the implementation of alloca
and such a system would be unwise to use the stack space for alloca, but
it is an issue with alloca in general - you may not have a lot of stack.

-- 
Gerph {djf0-.3w6e2w2.226,6q6w2q2,2.3,2m4}
URL: http://www.movspclr.co.uk/
... Eyes to the heavens, screaming at the sky;
    Trying to send you messages, but choking on goodbye.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]