On 06/01/12 19:59, Steven Schveighoffer wrote:
> On Fri, 01 Jun 2012 13:50:16 -0400, Walter Bright 
> <[email protected]> wrote:
> 
>> On 6/1/2012 5:29 AM, Steven Schveighoffer wrote:
>>> No. What we need is a non-throwing version of malloc that returns NULL.
>>
>> We have it. It's called "malloc"!
> 
> Oh sorry, I meant *GC.malloc* :)

auto GC_malloc(size_t s) nothrow { void *p; try p = GC.malloc(s); catch {} 
return p; }

Which isn't ideal, but probably good enough - it's not like OOM will happen
often enough that the exception overhead matters.
The various implicit allocations will be more problematic, once GC.malloc
starts to fail.

artur

Reply via email to