Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Init calls onOutOfMemoryError if malloc fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tcak committed Apr 7, 2016
1 parent d4f88a0 commit c9e3bff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rt/tlsgc.d
Expand Up @@ -32,7 +32,8 @@ struct Data
void* init()
{
auto data = cast(Data*).malloc(Data.sizeof);
if( data is null ) return null;
import core.exception;
if( data is null ) core.exception.onOutOfMemoryError();
*data = Data.init;

// do module specific initialization
Expand Down

0 comments on commit c9e3bff

Please sign in to comment.