Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
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
5 changes: 2 additions & 3 deletions src/object.di
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ template _isStaticArray(T)

private
{
extern (C) void _d_arrayshrinkfit(TypeInfo ti, void[] arr) pure nothrow;
extern (C) void _d_arrayshrinkfit(TypeInfo ti, void[] arr) nothrow;
extern (C) size_t _d_arraysetcapacity(TypeInfo ti, size_t newcapacity, void *arrptr) pure nothrow;
}

Expand All @@ -550,7 +550,7 @@ size_t reserve(T)(ref T[] arr, size_t newcapacity) pure nothrow @trusted
return _d_arraysetcapacity(typeid(T[]), newcapacity, cast(void *)&arr);
}

auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) pure nothrow
auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) nothrow
{
_d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr));
return arr;
Expand Down Expand Up @@ -626,4 +626,3 @@ version (unittest)
}
}
}

4 changes: 2 additions & 2 deletions src/object_.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private

extern (C) void onOutOfMemoryError() @trusted /* pure dmd @@@BUG11461@@@ */ nothrow;
extern (C) Object _d_newclass(const TypeInfo_Class ci);
extern (C) void _d_arrayshrinkfit(const TypeInfo ti, void[] arr) pure nothrow;
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;
extern (C) void rt_finalize(void *data, bool det=true);
}
Expand Down Expand Up @@ -2522,7 +2522,7 @@ unittest
* Returns:
* The input is returned.
*/
auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) pure nothrow
auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) nothrow
{
_d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr));
return arr;
Expand Down