On Sun, 22 Jun 1997, Bruce Momjian wrote:
> > okay, I'm not totally familiary with palloc()...I did a project while
> > back where we mmap()'d a region of memory so that we didn't need to write
> > to disk. Essentially, I used ftruncate() to create the size of the buffer I
> > wanted to mmap(), and never flushed the memory...
> >
> > Not sure what palloc() does though...should look into it, eh? :(
>
> palloc() basically malloc's from a pool that gets auto-free'd at the end
> of statements or transcations.
>
> We could us mmap(), but why bother if we can just malloc() all the
> memory we need? That is what has me confused. Anyone know an advantage
> to using mmap() when you really don't want the image on disk?
Okay...this is something I never truly have every succeeded in doing,
and do agree that it would be better then mmap()...mmap() is good when
multiple processes want/need to access the same memory, and, from what I've
seen, sort of acts as an intermediary between a malloc() and shmem()...
Now I understand what you are thinking :)
Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
------------------------------