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

Commit

Permalink
Merge pull request #887 from denis-sh/add-@nogc-to-core.exception
Browse files Browse the repository at this point in the history
Add `@nogc` attribute to `core.exception` functions.
  • Loading branch information
MartinNowak committed Jul 17, 2014
2 parents a458167 + 6c01335 commit 5b446ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/core/exception.d
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ Gets/sets assert hander. null means the default handler is used.
alias AssertHandler = void function(string file, size_t line, string msg) nothrow;

/// ditto
@property AssertHandler assertHandler() @trusted nothrow
@property AssertHandler assertHandler() @trusted nothrow @nogc
{
return _assertHandler;
}

/// ditto
@property void assertHandler(AssertHandler handler) @trusted nothrow
@property void assertHandler(AssertHandler handler) @trusted nothrow @nogc
{
_assertHandler = handler;
}
Expand All @@ -390,7 +390,7 @@ alias AssertHandler = void function(string file, size_t line, string msg) nothro
* Params:
* h = The new assert handler. Set to null to use the default handler.
*/
deprecated void setAssertHandler( AssertHandler h ) @trusted nothrow
deprecated void setAssertHandler( AssertHandler h ) @trusted nothrow @nogc
{
assertHandler = h;
}
Expand Down Expand Up @@ -509,7 +509,7 @@ extern (C) void onHiddenFuncError( Object o ) @safe pure nothrow
* Throws:
* OutOfMemoryError.
*/
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow /* dmd @@@BUG11461@@@ */
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
{
// NOTE: Since an out of memory condition exists, no allocation must occur
// while generating this object.
Expand All @@ -524,7 +524,7 @@ extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure
* Throws:
* InvalidMemoryOperationError.
*/
extern (C) void onInvalidMemoryOperationError(void* pretend_sideffect = null) @trusted pure nothrow /* dmd @@@BUG11461@@@ */
extern (C) void onInvalidMemoryOperationError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
{
// The same restriction applies as for onOutOfMemoryError. The GC is in an
// undefined state, thus no allocation must occur while generating this object.
Expand Down
2 changes: 1 addition & 1 deletion src/gcstub/gc.d
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private
}

extern (C) void thread_init();
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow; /* dmd @@@BUG11461@@@ */
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc; /* dmd @@@BUG11461@@@ */

struct Proxy
{
Expand Down
2 changes: 1 addition & 1 deletion src/object_.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private
import rt.util.string;
debug(PRINTF) import core.stdc.stdio;

extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow; /* dmd @@@BUG11461@@@ */
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc; /* dmd @@@BUG11461@@@ */
extern (C) Object _d_newclass(const TypeInfo_Class ci);
extern (C) void _d_arrayshrinkfit(const TypeInfo ti, void[] arr) nothrow;
extern (C) size_t _d_arraysetcapacity(const TypeInfo ti, size_t newcapacity, void *arrptr) pure nothrow;
Expand Down

0 comments on commit 5b446ab

Please sign in to comment.