www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Symbol registerMemoryErrorHandler not found when compiling with LDC

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
Does

/// See_Also: 
https://forum.dlang.org/post/nzazqswxadqzyoghwhzh forum.dlang.org
static this()
{
     import etc.linux.memoryerror : registerMemoryErrorHandler;
     registerMemoryErrorHandler();
}

only work with DMD?

With LDC I get

base.d:908: error: undefined reference to 
'_D3etc5linux11memoryerror26registerMemoryErrorHandlerFZb'
Dec 17 2018
parent kinke <noone nowhere.com> writes:
On Monday, 17 December 2018 at 15:10:13 UTC, Per Nordlöw wrote:
 With LDC I get

 base.d:908: error: undefined reference to 
 '_D3etc5linux11memoryerror26registerMemoryErrorHandlerFZb'
https://github.com/ldc-developers/ldc/issues/1915 Arbitrary operations such as writing into some invalid address potentially leading to thrown errors/exceptions doesn't fit into the LLVM IR model for exception-handling IIRC; one can catch/resume from calls to potentially throwing functions, but not from arbitrary writes etc.
Dec 17 2018