Fix some safety annotation issues.
This commit is contained in:
parent
ccbd6a063f
commit
81b7010724
|
@ -106,7 +106,7 @@ struct FreeListRef(T, bool INIT = true)
|
|||
private size_t m_magic = 0x1EE75817; // workaround for compiler bug
|
||||
|
||||
static FreeListRef opCall(ARGS...)(ARGS args)
|
||||
@safe {
|
||||
{
|
||||
//logInfo("refalloc %s/%d", T.stringof, ElemSize);
|
||||
FreeListRef ret;
|
||||
ret.m_object = ObjAlloc.alloc(args);
|
||||
|
@ -187,7 +187,7 @@ in {
|
|||
format("emplace: Chunk size too small: %s < %s size = %s",
|
||||
chunk.length, T.stringof, T.sizeof));
|
||||
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", chunk.ptr, T.alignof, T.stringof));
|
||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
||||
|
||||
} body {
|
||||
enum classSize = __traits(classInstanceSize, T);
|
||||
|
@ -226,7 +226,7 @@ in {
|
|||
format("emplace: Chunk size too small: %s < %s size = %s",
|
||||
chunk.length, T.stringof, T.sizeof));
|
||||
assert((cast(size_t) chunk.ptr) % T.alignof == 0,
|
||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", chunk.ptr, T.alignof, T.stringof));
|
||||
format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", &chunk[0], T.alignof, T.stringof));
|
||||
|
||||
} body {
|
||||
return emplace(() @trusted { return cast(T*)chunk.ptr; } (), args);
|
||||
|
|
Loading…
Reference in a new issue