&gt;Perhaps, it might be an idea to get rid of dynamically allocated<br>
&gt;path strings, and use arrays instead ? This might vastly improve<br>
&gt;performance at cost of memory, I suspect.<br>You mean using &quot;char foo[5]&quot; as opposed to &quot;char* foo = malloc(5)&quot;? I&#39;m not sure what you mean because dynamically allocated path strings are pretty much arrays (all strings are).<br>
<br>If you do mean using foo[5], then there&#39;s no change, only that it allocates things on the stack, which is much more limited and can have horrible consequences if an overflow happens. Furthermore, the size is fixed, meaning that you can&#39;t, in this extreme case, use the path &quot;hello&quot; because it uses 6 characters (&quot;hello&quot; + \0 termination).<br>
<br><div class="gmail_quote">On 29 September 2010 17:58, Tolga Dalman <span dir="ltr">&lt;<a href="mailto:tolga.dalman@googlemail.com">tolga.dalman@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div><div class="im">On 09/29/10 17:33, Christoph Nelles wrote:<br>
&gt; yes, looks like this is a problem:<br>
&gt; <a href="http://stackoverflow.com/questions/482375/strdup-function" target="_blank">http://stackoverflow.com/questions/482375/strdup-function</a><br>
<br>
</div>Indeed, strdup is POSIX only.<br>
<div class="im"><br>
&gt; And you are forced to use free(). allocator.malloc/free may use other<br>
&gt; functions.<br>
&gt;<br>
&gt; So why worrying about saving one LOC.<br>
<br>
</div>Actually, I sent the patch for fixing the erroneous check.<br>
<br>
Perhaps, it might be an idea to get rid of dynamically allocated<br>
path strings, and use arrays instead ? This might vastly improve<br>
performance at cost of memory, I suspect.<br>
<br>
Are there any PhysFS performance tests available ?<br>
<div class="im">-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.16 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
</div>iQEcBAEBAgAGBQJMo2ImAAoJEI0vwg8AaIlUfIoH/1Y9rW3dTwx87Pemd2CAIBA+<br>
2blCY09qmG4kS6R5wM21/V14AK0FW8IAsxJsUExr5KxL1ZnH3xWTFcwkKkuiv++c<br>
bXQEvICh6s2ldCuZ988GZChVMtHuNpY3z5UcsgGVEZcr3QXL6wI9hbcPRhCITMkT<br>
dUmGGIYj3QcV2i2Ou+kBCPyLpAZnPyVDujBWJbw2Jk0BxzMxKFS+/9QM8qre74kH<br>
gSdZRx2QE58yVQU+IPiUdpUAiM21GBvyqgUyoOnrD2leCa0jozz8l9P27cVbUWun<br>
pqdKTf8XnRmIfntW3NqYXieTZI+MPeilKNZtJBUQ9JbrjpFPSVFs8ouOGHeWOPk=<br>
=151X<br>
-----END PGP SIGNATURE-----<br>
<div><div></div><div class="h5">_______________________________________________<br>
physfs mailing list<br>
<a href="mailto:physfs@icculus.org">physfs@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
</div></div></blockquote></div><br>