Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/core/stdc/stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ else version (WatchOS)
extern (C):
@system:

/* Placed outside @nogc in order to not constrain what the callback does.
/* Placed outside `nothrow` and `@nogc` in order to not constrain what the callback does.
*/
///
alias int function(const void*, const void*) _compare_fp_t;
alias _compare_fp_t = int function(const void*, const void*);

nothrow:
@nogc:

///
inout(void)* bsearch(const void* key, inout(void)* base, size_t nmemb, size_t size, _compare_fp_t compar);
///
Expand All @@ -51,9 +55,6 @@ void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar);
bsearch(&key, arr.ptr, arr[0].sizeof, arr.length, &S.cmp);
}

nothrow:
@nogc:

///
struct div_t
{
Expand Down
2 changes: 1 addition & 1 deletion src/rt/profilegc.d
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ shared static ~this()
Entry entry;

// qsort() comparator to sort by count field
extern (C) static int qsort_cmp(scope const void *r1, scope const void *r2)
extern (C) static int qsort_cmp(scope const void *r1, scope const void *r2) @nogc nothrow
{
auto result1 = cast(Result*)r1;
auto result2 = cast(Result*)r2;
Expand Down
4 changes: 2 additions & 2 deletions src/rt/trace.d
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void stack_free(Stack *s)
//////////////////////////////////////
// Qsort() comparison routine for array of pointers to SymPair's.

private int sympair_cmp(scope const void* e1, scope const void* e2)
private int sympair_cmp(scope const void* e1, scope const void* e2) nothrow @nogc
{
auto count1 = (*cast(SymPair**)e1).count;
auto count2 = (*cast(SymPair**)e2).count;
Expand Down Expand Up @@ -271,7 +271,7 @@ private void trace_array(Symbol*[] psymbols, Symbol *s, ref uint u)
//////////////////////////////////////
// Qsort() comparison routine for array of pointers to Symbol's.

private int symbol_cmp(scope const void* e1, scope const void* e2)
private int symbol_cmp(scope const void* e1, scope const void* e2) nothrow @nogc
{
auto ps1 = cast(Symbol **)e1;
auto ps2 = cast(Symbol **)e2;
Expand Down