[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] valloc()?
From: |
Derek Price |
Subject: |
Re: [bug-gnulib] valloc()? |
Date: |
Wed, 02 Mar 2005 19:20:32 -0500 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bruno Haible wrote:
| Therefore I'd suggest a new interface: void*
| pagealign_alloc(size_t); void pagealign_free(void*);
|
| and do the implementation as follows: - If mmap() is available, use
| mmap and some bookkeeping for pagealign_alloc, and munmap() for
| pagealign_free, - Otherwise, if posix_memalign() is available, use
| it and free(), - Otherwise, use something similar to the valloc()
| above.
Why do you prefer mmap to posix_memalign? I'm almost done with the
implementation you suggested (I'm testing the MMAP version now, then
I'll go through with various combinations of HAVE_MMAP,
HAVE_MAP_ANONYMOUS, and HAVE_POSIX_MEMALIGN, but it strikes me that my
bookkeeping for mmap could slow things down if many blocks were
allocated (I'm storing the ptr->size map in a simple linked list, but
even something more efficient would eventually slow).
Regards,
Derek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCJlhQLD1OTBfyMaQRAijMAKDlaI1EPq2SBaMxtE9bVy6zrZCbRACfUDWw
/UHJwKT7V8NkEGaoQ1Ge68A=
=qqlR
-----END PGP SIGNATURE-----
- [bug-gnulib] valloc()?, Derek Price, 2005/03/01
- Re: [bug-gnulib] valloc()?,
Derek Price <=
- Re: [bug-gnulib] valloc()?, Derek Price, 2005/03/03
- Re: [bug-gnulib] valloc()?, Bruno Haible, 2005/03/03
- Re: [bug-gnulib] valloc()?, Derek Price, 2005/03/03
- Re: [bug-gnulib] valloc()?, Bruno Haible, 2005/03/03
- Re: [bug-gnulib] valloc()?, Derek Price, 2005/03/03