@@ -19,29 +19,6 @@ void __switch_errorT()(string file = __FILE__, size_t line = __LINE__) @trusted
19
19
assert (0 , " No appropriate switch clause found" );
20
20
}
21
21
22
- version (D_BetterC )
23
- {
24
- // When compiling with -betterC we use template functions so if they are
25
- // used the bodies are copied into the user's program so there is no need
26
- // for the D runtime during linking.
27
-
28
- // In the future we might want to convert all functions in this module to
29
- // templates even for ordinary builds instead of providing them as an
30
- // extern(C) library.
31
-
32
- void onOutOfMemoryError ()(void * pretend_sideffect = null ) @nogc nothrow pure @trusted
33
- {
34
- assert (0 , " Memory allocation failed" );
35
- }
36
- alias onOutOfMemoryErrorNoGC = onOutOfMemoryError;
37
-
38
- void onInvalidMemoryOperationError ()(void * pretend_sideffect = null ) @nogc nothrow pure @trusted
39
- {
40
- assert (0 , " Invalid memory operation" );
41
- }
42
- }
43
- else :
44
-
45
22
/**
46
23
* Thrown on a range error.
47
24
*/
@@ -692,26 +669,49 @@ extern (C) void onFinalizeError( TypeInfo info, Throwable e, string file = __FIL
692
669
throw staticError! FinalizeError(info, e, file, line);
693
670
}
694
671
695
- /**
696
- * A callback for out of memory errors in D. An $(LREF OutOfMemoryError) will be
697
- * thrown.
698
- *
699
- * Throws:
700
- * $(LREF OutOfMemoryError).
701
- */
702
- extern (C ) void onOutOfMemoryError(void * pretend_sideffect = null ) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
672
+ version (D_BetterC )
703
673
{
704
- // NOTE: Since an out of memory condition exists, no allocation must occur
705
- // while generating this object.
706
- throw staticError! OutOfMemoryError();
707
- }
674
+ // When compiling with -betterC we use template functions so if they are
675
+ // used the bodies are copied into the user's program so there is no need
676
+ // for the D runtime during linking.
708
677
709
- extern (C ) void onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
710
- {
711
- // suppress stacktrace until they are @nogc
712
- throw staticError! OutOfMemoryError(false );
678
+ // In the future we might want to convert all functions in this module to
679
+ // templates even for ordinary builds instead of providing them as an
680
+ // extern(C) library.
681
+
682
+ void onOutOfMemoryError ()(void * pretend_sideffect = null ) @nogc nothrow pure @trusted
683
+ {
684
+ assert (0 , " Memory allocation failed" );
685
+ }
686
+ alias onOutOfMemoryErrorNoGC = onOutOfMemoryError;
687
+
688
+ void onInvalidMemoryOperationError ()(void * pretend_sideffect = null ) @nogc nothrow pure @trusted
689
+ {
690
+ assert (0 , " Invalid memory operation" );
691
+ }
713
692
}
693
+ else
694
+ {
695
+ /**
696
+ * A callback for out of memory errors in D. An $(LREF OutOfMemoryError) will be
697
+ * thrown.
698
+ *
699
+ * Throws:
700
+ * $(LREF OutOfMemoryError).
701
+ */
702
+ extern (C ) void onOutOfMemoryError(void * pretend_sideffect = null ) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
703
+ {
704
+ // NOTE: Since an out of memory condition exists, no allocation must occur
705
+ // while generating this object.
706
+ throw staticError! OutOfMemoryError();
707
+ }
714
708
709
+ extern (C ) void onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
710
+ {
711
+ // suppress stacktrace until they are @nogc
712
+ throw staticError! OutOfMemoryError(false );
713
+ }
714
+ }
715
715
716
716
/**
717
717
* A callback for invalid memory operations in D. An
0 commit comments