May 24, 2012 [Issue 8135] throwing Error runs finally handler | ||||
---|---|---|---|---|
| ||||
Posted in reply to dawg@dawgfoto.de | http://d.puremagic.com/issues/show_bug.cgi?id=8135 --- Comment #10 from Alex Rønne Petersen <alex@lycus.org> 2012-05-24 18:44:33 CEST --- (In reply to comment #8) > (In reply to comment #4) > > FWIW, I'm all for making Errors actually fatal and terminating the runtime immediately, but then OutOfMemory*Error* HAS GOT TO GO. > > Then you could mark almost nothing as nothrow. True. > > I think OutOfMemory should be an error. If you want to override the behavior because you have special circumstances, that should be possible (i.e. somehow prevent out of memory error from being thrown, but instead handle the situation in a different way). > > What about an enhancement of adding GC.mallocNoError and friends which instead return null when a memory block is not available instead of throwing? That could work too. I really just want the GC to not assume that an allocation error is fatal. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 24, 2012 [Issue 8135] throwing Error runs finally handler | ||||
---|---|---|---|---|
| ||||
Posted in reply to dawg@dawgfoto.de | http://d.puremagic.com/issues/show_bug.cgi?id=8135 --- Comment #11 from dawg@dawgfoto.de 2012-05-24 12:55:08 PDT --- >That could work too. I really just want the GC to not assume that an allocation error is fatal. You could simply override the behavior by providing your own 'extern(C) void onOutOfMemory()'. The linker will pick the one from druntime with the lowest precedence. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 25, 2012 [Issue 8135] throwing Error runs finally handler | ||||
---|---|---|---|---|
| ||||
Posted in reply to dawg@dawgfoto.de | http://d.puremagic.com/issues/show_bug.cgi?id=8135 --- Comment #12 from Alex Rønne Petersen <alex@lycus.org> 2012-05-25 04:35:42 CEST --- (In reply to comment #11) > >That could work too. I really just want the GC to not assume that an allocation error is fatal. > > You could simply override the behavior by providing your own > 'extern(C) void onOutOfMemory()'. The linker will pick the one > from druntime with the lowest precedence. I don't always want out of memory to be handled. In most cases, I do treat it as fatal, but in the few cases I don't, I just want to get a null value back from allocations in the core.memory module. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation