--- [EMAIL PROTECTED] wrote:
> Mostly I am interested in making sure that malloc(1000) does not
> fail even though you have 50000 bytes free and they just happen
> to be scattered about as 100 discontinguous blocks of 500 bytes
> each.  

It's a good goal. You can reduce the likelihood of failure perhaps, 
but I don't think that you can guarantee it without moving blocks
and reswivelling all the pointers.

Most of the better mallocs already perform the similar-size block
pool optimization.

> > Also, I'm not sure how many libc functions sqlite uses at this 
> > point. But some of them could malloc memory that is beyond the reach 
> > of your pools. Then there's the application's mallocs to consider
> > as well. 
> 
> memcpy, memset, strlen.  I think that is about the full set.
> SQLite does not use libc very much, as that limits its portability
> to embedded platforms.

There's also the date functions localtime and gettimeofday. Perhaps
they don't malloc in most implementations.

> > Are you planning to keep allocations from different connections 
> > from different databases seperate? It would be nice to have 
> > unrelated databases on different threads not share a common memory 
> > pool which would help multi-threaded concurrency.
> 
> Partially.  My plan is to have a single global memory space that
> all threads share.  But each thread grabs big hunks of that space
> for its own use on (relatively) infrequent occasions - or at least
> with less frequency than mallocs currently occur.  So the
> synchronization overhead, while not zero, is reduced.

Anything is better than 'the one big malloc lock' for concurrency.

Is this memory pooling going to be compile-time optional?

I find that library-specific memory pools are awkward because each
library tends to have its own schemes that don't play well with each
other. If you use pools, then that limits the effectiveness of Hoard 
or Boehm GC in a big application.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to