[physfs] Replace malloc/strcpy by strdup

Christoph Nelles evilazrael at evilazrael.de
Wed Sep 29 12:59:54 EDT 2010

Am 29.09.2010 17:58, schrieb Tolga Dalman:
> Perhaps, it might be an idea to get rid of dynamically allocated
> path strings, and use arrays instead ? This might vastly improve
> performance at cost of memory, I suspect.

That is a good idea, but to support old C standards resp. compilers you
have to declare them at the beginning of the blocks, probably wasting
memory if unneeded. A problem might be maximum length of paths. Systems
have a maximum path length MAX_PATH (or PATH_MAX?) and this might be
exceeded by virtual paths with utf-8 characters in it. So you would have
to limit it or stick with dynamically allocated memory.
Christoph Nelles

E-Mail    : evilazrael at evilazrael.de
Jabber    : eazrael at evilazrael.net      ICQ       : 78819723

PGP-Key   : ID 0x424FB55B on subkeys.pgp.net
            or http://evilazrael.net/pgp.txt

More information about the physfs mailing list