<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 24, 2015 at 8:44 PM, Nicolai Hess <span dir="ltr">&lt;<a href="mailto:nicolaihess@web.de" target="_blank">nicolaihess@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2015-08-24 13:34 GMT+02:00 Henrik Johansen <span dir="ltr">&lt;<a href="mailto:henrik.s.johansen@veloxit.no" target="_blank">henrik.s.johansen@veloxit.no</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On 23 Aug 2015, at 6:09 , Nicolai Hess &lt;<a href="mailto:nicolaihess@web.de" target="_blank">nicolaihess@web.de</a>&gt; wrote:</div><br><div><div dir="ltr">And If you want to review the changes:<br><br><a href="https://github.com/nicolaihess/pharo-vm/compare/master...nicolaihess:win-long-filename" target="_blank">https://github.com/nicolaihess/pharo-vm/compare/master...nicolaihess:win-long-filename</a><br><br><div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-23 13:44 GMT+02:00 Nicolai Hess <span dir="ltr">&lt;<a href="mailto:nicolaihess@web.de" target="_blank">nicolaihess@web.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>For those who had problems with pharo on windows and github based repositories,<br></div>I built a windows vm with support for long paths:<br><br><a href="https://drive.google.com/file/d/0B8yEahnuIem2bmxwdzJuUXFxVGM/view?usp=sharing" target="_blank">https://drive.google.com/file/d/0B8yEahnuIem2bmxwdzJuUXFxVGM/view?usp=sharing</a><br><br></div><div><br>For browsing directories with large paths (FileList or Inspect),<br>you may need one additional change in the image (But I am not really sure about that) :<br></div><div><br></div><div>DiskStore&gt;&gt;initialize<br>    super initialize.<br>    maxFileNameLength := Smalltalk vm maxFilenameLength ifNil: [ 32767 ].<br><br><br></div>please test and give feedback.<br><br></div>This wasn&#39;t as easy as I thought, and I had to make some more changes<br></div>for the file permissions (the stat-functions don&#39;t work for files with long paths).<br></div>Please test other file/folder operations.<span><font color="#888888"><br><br></font></span></div></div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>- Is an alloca version really worth it for the potential problems?</div></div></blockquote><div><br></div></span><div>It is what Marcel used for the long path support in the squeak vm (I would have copy and paste the whole change, but I couldn&#39;t find the appropriate change for directory functions).<br></div><span class=""><div> </div></span></div></div></div></blockquote><div><br></div><div> &quot;Potential problems&quot; sounded like something interesting I could learn.  Here is a summary... </div><div><br></div><div><a href="http://stackoverflow.com/questions/5807612/on-the-use-and-abuse-of-alloca">http://stackoverflow.com/questions/5807612/on-the-use-and-abuse-of-alloca</a><br></div><div>On the use and abuse of alloca<br></div><div>  * alloca five times faster than malloc (but is that necessary given file operations likely take longer anyway?)<br></div><div>  * most concerns with alloca no problem here e.g. its a very short lifespan; the pointer is not returned from the function. </div><div><br></div><div><a href="http://www.strchr.com/alloca">http://www.strchr.com/alloca</a><br></div><div></div><div>The Perils of alloca()</div><div>  * remaining concern is potential stack exhaustion...<br></div><div><div>     * is <span style="color:rgb(0,0,0)">MAX_LONG_FILE_PATH=</span>32kB significant today (but also consider embedded application) ?</div><div>     * counter argument, primitive functions are not likely to entered recursively ?</div></div><div><br></div><div>Microsoft advises alloca [1] deprecated in favour of malloca [2] which allocates either stack or heap depending on requested size</div><div>    [1] <a href="https://msdn.microsoft.com/en-us/library/wb1s57t5(v=vs.80).aspx">https://msdn.microsoft.com/en-us/library/wb1s57t5(v=vs.80).aspx</a><br></div><div><div>    [2] <a href="https://msdn.microsoft.com/en-us/library/5471dc8s(VS.80).aspx">https://msdn.microsoft.com/en-us/library/5471dc8s(VS.80).aspx</a></div></div><div><br></div><div><a href="https://sourceware.org/ml/libc-alpha/2012-06/msg00246.html">https://sourceware.org/ml/libc-alpha/2012-06/msg00246.html</a><br></div><div>An example of a DIY malloca...</div><div>  * might have the advantage of tuning <span style="color:rgb(0,0,0)">MAX_ALLOCA_CUTOFF post-compilation</span><br></div><div><span style="color:rgb(0,0,0)">  * minGW gcc might not have malloca</span></div><div><span style="color:rgb(0,0,0)">  * if large allocations go on the heap, maybe </span><font color="#000000">MAX_LONG_FILE_PATH test not required, just </font><span style="color:rgb(0,0,0)">MAX_ALLOCA_CUTOFF</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">----------</span></div><div><span style="color:rgb(0,0,0)">btw, perhaps rename </span><font color="#000000">CONVERT_MULTIBYTE_TO_WIDECHAR_PATH</font></div><div><font color="#000000">to ALLOC_WIDECHAR_PATH_FROM_MULTIBYTE </font><span style="color:rgb(0,0,0)">or similar </span></div><div><span style="color:rgb(0,0,0)">so its more obviously symmetrical with FREE_WIDECHAR_PATH.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">cheers -ben</span></div></div></div></div>