1
0
Fork 0
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:
Brian Fiete 2025-01-29 06:54:09 -08:00
parent f7120e4c72
commit 5b23020140
3 changed files with 27 additions and 22 deletions

View file

@ -23,6 +23,7 @@ namespace System.IO
mString = appendStr;
}
[DisableChecks]
public ~this()
{
if (mStringKind == .Append)

View file

@ -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: