No comment...<div><br></div><div>I'm also finding that I really need an assert hook. The default assert implementation is not useful to me, and just crashes my programs (exceptions when interacting with C is problematic).</div>
<div>I'd like to route runtime asserts through my own system. A simple backend hook would sort me out here too..</div><div><br></div><div>Does anyone know any existing way to do the stuff I'm talking about here?</div>
<div>If not, what do people think about the possibility of putting hook register functions into druntime?</div><div><br></div><div><div class="gmail_quote">On 9 April 2012 03:59, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So one thing that almost every major middleware provides, is an interface to hook your own allocation and filesystem callbacks under the hood, to allow integration with your potentially complex technology.<div>
<br></div><div>
In my industry, memory and filesystem hooks are non-negotiable. We can't use any middleware that does not provide them.</div><div>Traditionally, we have a problem with the C library, and many core C libs which depend heavily on the CRT. Almost all games engines have to wastefully rewrite large portions of the CRT, just to implement the appropriate memory and filesystem interface, and some super handy common libs are lost to us due to lack of this foresight.</div>

<div><br></div><div>So this in mind, many of the goodies in phobos are currently unusable to us (although fortunately source is available).</div><div>Has it ever been considered to allow hooks into the backends of those systems which could be registered at runtime?</div>

<div>It would be simple to provide an API where you could register the filesystem primitives, which all standard libraries would then magically route through (huzzah!).</div><div>A primitive malloc/free hook would be nice to have too, that way we can direct memory to the appropriate locations, and keep mem stats along with the the rest of the system.</div>

<div>It's not uncommon to malloc the entire heap on boot, and implement our own heap management through our own API's. Obviously system functions would fail to allocate memory in this environment...</div><div><br>

</div><div>Having these hooks in phobos would also lift this burden off of library developers (usually only added on request with a few months turn around time, which is no good for project scheduling), and it would never prevent us access to those libraries where the developers never considered our use case.</div>

</blockquote></div><br></div>