Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh and memory

On Dec 16, 10:56am, Sven Wischnowsky wrote:
} Subject: Re: zsh and memory
} [...] I looked who was using lots of heap memory and found the
} tokstr handling in lex.c. There we always allocate at least 256 bytes
} and if the buffer needs expanding (in add()) in gets resized to
} inbufct (or larger). Some more investigation showed that we almost
} never need a tokstr with more than 32 bytes, so I changed that.  I also 
} changed add() to be more careful when expanding the buffer -- I left
} the old code conditioned out because I don't kno if there was a reason 
} to resize it to inbufct bytes; I at least don't see a reason for that.

Probably the idea was to eliminate lots of small allocations in the
event that the "token" is a long quoted string or the like, for speed.
We should watch out for performance problems if those changes are kept.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Messages sorted by: Reverse Date, Date, Thread, Author