Re: Memory allocation

Kalle Olavi Niemitalo <[email protected]>
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
Jonas Fonseca <[email protected]> writes:

> Kalle Olavi Niemitalo <[email protected]> wrote Thu, May 31, 2007:
>> Which reminds me of bug 297.  Can we use libapr for memory pools?
>
> I remember Miciah also mentioning talloc by the Samba devs.

APR is under Apache License Version 2.0, which the FSF considers
incompatible with GNU GPL v2.  So we shouldn't use that in
ELinks.

Talloc is under GNU Lesser General Public License v2 or later,
and LGPLv2.1 section 3 allows conversion to GPLv2 or later.
However, talloc is not an interactive program, so I think GPLv2
clause 2c would then require ELinks to display an announcement
on each ordinary startup, which ELinks does not yet do.  Probably
the samba folks would be willing to rescind this requirement.

Unfortunately, each talloc() call allocates its memory with
malloc(), so making ELinks use talloc() instead of malloc() would
not actually help with bug 297, which is about returning the
memory back to the operating system rather than just to libc.  To
do that, we'll need mmap, I think.  And there doesn't seem to be
a way to plug mmap into talloc, so if we want to fix bug 297, we
cannot use talloc.  (In principle, one could redefine the malloc
used by talloc, but that would violate C99 and perhaps POSIX too,
and the interface of malloc doesn't allow any hints on which
allocations are related and should be put in the same page.)

_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGasPxHm9IGt60eMgRAvfiAKDBIFanTLfWfhG1arO2RVCgR22FRQCfU5lO
VjetMDojWfiTXQ0t4egd7Zk=
=RiFV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.