
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
"CBFalconer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> D Yuniskis wrote:
> >
> ... snip ...
> >
> > For example, I have a variable precision math library that
> > allocates the "Number's" from a pool of fixed size buffers
> > (called a "partition" in some systems). Since each is a fixed
> > size, this makes the allocation extremely fast (O(1)) as well
> > as letting me copy/move values around easily.
>
> O(1) allocation is not hard to achieve. The problem is O(1)
> free() (and thus possibly realloc()) when there is a need to
> recombine all freed areas.
Note:
...from a pool of fixed size buffers (called a "partition" in some
systems).
--------------------^^^^^^^^^^^^^
Both malloc and free are *inherently* constant time operations
in such a scheme (hence the reason it was chosen! :>)
--don
N.B. Incoming mail is not accepted at this email address.
| <-- __Chronological__ --> | <-- __Thread__ --> |