[physfs] Replace malloc/strcpy by strdup

Tolga Dalman tolga.dalman at googlemail.com
Wed Sep 29 11:58:30 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/10 17:33, Christoph Nelles wrote:
> yes, looks like this is a problem:
> http://stackoverflow.com/questions/482375/strdup-function

Indeed, strdup is POSIX only.

> And you are forced to use free(). allocator.malloc/free may use other
> functions.
> 
> So why worrying about saving one LOC.

Actually, I sent the patch for fixing the erroneous check.

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.

Are there any PhysFS performance tests available ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMo2ImAAoJEI0vwg8AaIlUfIoH/1Y9rW3dTwx87Pemd2CAIBA+
2blCY09qmG4kS6R5wM21/V14AK0FW8IAsxJsUExr5KxL1ZnH3xWTFcwkKkuiv++c
bXQEvICh6s2ldCuZ988GZChVMtHuNpY3z5UcsgGVEZcr3QXL6wI9hbcPRhCITMkT
dUmGGIYj3QcV2i2Ou+kBCPyLpAZnPyVDujBWJbw2Jk0BxzMxKFS+/9QM8qre74kH
gSdZRx2QE58yVQU+IPiUdpUAiM21GBvyqgUyoOnrD2leCa0jozz8l9P27cVbUWun
pqdKTf8XnRmIfntW3NqYXieTZI+MPeilKNZtJBUQ9JbrjpFPSVFs8ouOGHeWOPk=
=151X
-----END PGP SIGNATURE-----


More information about the physfs mailing list