mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Allow 'DisableChecks' to remove append dtor check
This commit is contained in:
parent
f7120e4c72
commit
5b23020140
3 changed files with 27 additions and 22 deletions
|
@ -23,6 +23,7 @@ namespace System.IO
|
|||
mString = appendStr;
|
||||
}
|
||||
|
||||
[DisableChecks]
|
||||
public ~this()
|
||||
{
|
||||
if (mStringKind == .Append)
|
||||
|
|
|
@ -437,7 +437,7 @@ namespace System
|
|||
#endif
|
||||
}
|
||||
|
||||
public static void Dbg_AppendDeleted(Object rootObj)
|
||||
public static void Dbg_AppendDeleted(Object rootObj, bool doChecks)
|
||||
{
|
||||
#if BF_ENABLE_OBJECT_DEBUG_FLAGS
|
||||
void Handle(AppendAllocEntry* headAllocEntry)
|
||||
|
@ -448,11 +448,14 @@ namespace System
|
|||
switch (checkAllocEntry.mKind)
|
||||
{
|
||||
case .Object(let obj):
|
||||
#unwarn
|
||||
if (!obj.[DisableObjectAccessChecks]IsDeleted())
|
||||
if (doChecks)
|
||||
{
|
||||
if (obj.GetType().HasDestructor)
|
||||
Debug.FatalError("Appended object not deleted with 'delete:append'");
|
||||
#unwarn
|
||||
if (!obj.[DisableObjectAccessChecks]IsDeleted())
|
||||
{
|
||||
if (obj.GetType().HasDestructor)
|
||||
Debug.FatalError("Appended object not deleted with 'delete:append'");
|
||||
}
|
||||
}
|
||||
case .Raw(let rawPtr, let allocData):
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue