Stack memory allocation


Subject: Stack memory allocation
From: Aaron Lehmann (aaronl@vitelus.com)
Date: Thu Jul 13 2000 - 11:57:33 CDT


This patch reminded me off all the numerous places in the code that just
use char[4096] and limit the size of the string to that long. These really
gross me out but I'm afraid of a performance penalty if I replace them
with malloc() and the right size. It just seems wrong to be wasteful with
4096k!!! (I'm an assembly programmer too :)). Any ideas?

On Thu, 13 Jul 2000, WJCarpenter wrote:

> This patch, against 071200 nightly sources, removes a few instances of
> memory allocations and frees that don't have to happen. Code is XP,
> tested on Linux.
>
> 1. In fp_TextRun::_drawSquiggle(), automatic storage is now used if
> the number of points in the squiggle is less than 100, which covers
> most cases. This routine is called on the way to drawing squiggles
> under misspelled words.
>
> 2. In fp_TabRun::_drawArrow(), a polyline with 8 points is used to
> draw an arrow for invisible tab characters. The function now uses an
> automatic storage array of 8 points.
>
> I just happened to stumble across these as I was poking around looking
> for something else.
> --
> bill@carpenter.ORG (WJCarpenter) PGP 0x91865119
> 38 95 1B 69 C9 C6 3D 25 73 46 32 04 69 D6 ED F3
>
>



This archive was generated by hypermail 2b25 : Thu Jul 13 2000 - 11:58:09 CDT