lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev [PATCH] to dev13 - various fixes


From: Vlad Harchev
Subject: Re: lynx-dev [PATCH] to dev13 - various fixes
Date: Thu, 4 Nov 1999 05:04:39 +0400 (SAMT)

On Thu, 4 Nov 1999, Leonid Pauzner wrote:

> 31-Oct-99 18:04 Vlad Harchev wrote:
> > * Added comments about pools.
> 
> 
> > --- lynx2-8-3dev13u-was/src/GridText.c        Fri Oct 29 18:26:35 1999
> > +++ lynx2-8-3dev13u/src/GridText.c    Sun Oct 31 15:24:34 1999
> 
> > +same members as HTStyleChangePool). Pools are used for allocation of groups
> > +of objects of the same type T. Pools are represented as a list of 
> > structures
> > +of type P (called pool chunks here). Structure P has an array of N objects 
> > of
> > +type T named 'data' (the number N in the array can be chosen arbitrary),
> > +pointer to the next pool chunk named 'pool', and the number of free items
> > +in that pool chunk named 'free_items'. Ie, here is a definition of the
> > +structure P:
> > +     struct P
> > +     {
> > +         T data[N];
> > +         struct P* next;
> > +         int free_items;
> > +     };
> > + It's recommened that sizeof(P) be memory page size minus 32 in order 
> > malloced
> > +chunks to fit in machine page size.
> > + Allocation of 'n' items in the pool is implemented as decrementing member
> > +'free_items' by 'n' if 'free_items' >= 'n', or allocating a new pool chunk 
> > and
> > +allocating 'n' items in that new chunk. It's task of programmer to assert 
> > that
> > +'n' is <= N. Only entire pool may be freed - this limitation makes 
> > allocation
> > +algorithms trivial and fast - so the use of pools is limited to objects 
> > that
> > +are freed in batch, that are not deallocated not in the batch, and not
> > +reallocated.
> 
> There is probably an exception in lynx internals:
> TEXTAREA editing code make a surgery on HText object
> which was previously allocated.
> Have no idea about color styles but seems that part of code
> may be affected by textarea growth.
> (my $0.02).

  I hope all will be OK - as I remember, no HTLine's are  allocated in the
textarea growing code.

 Best regards,
 -Vlad


reply via email to

[Prev in Thread] Current Thread [Next in Thread]