1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

Fixed issues using object flags on on-debug default alloc

This commit is contained in:
Brian Fiete 2020-05-15 10:33:56 -07:00
parent 66216ce5d9
commit 63c6421413
8 changed files with 50 additions and 12 deletions

View file

@ -24,8 +24,9 @@ namespace System.Diagnostics
#if !DEBUG
[CallingConvention(.Cdecl), SkipCall]
#endif
#else
[CallingConvention(.Cdecl)]
#endif
static extern void Write(char8* str, int strLen);
public static void WriteLine(StringView line)

View file

@ -1,4 +1,4 @@
#if BF_ENABLE_REALTIME_LEAK_CHECK || BF_DEBUG_ALLOC
#if BF_ENABLE_OBJECT_DEBUG_FLAGS || BF_DEBUG_ALLOC
#define BF_DBG_RUNTIME
#endif

View file

@ -589,9 +589,10 @@ namespace IDE.Compiler
SetOpt(options.mEmitDynamicCastCheck, .EmitDynamicCastCheck);
SetOpt(enableObjectDebugFlags, .EnableObjectDebugFlags);
SetOpt(emitObjectAccessCheck, .EmitObjectAccessCheck);
#if BF_PLATFORM_WINDOWS
SetOpt(options.mEnableRealtimeLeakCheck, .EnableRealtimeLeakCheck);
#endif
if (options.LeakCheckingEnabled)
SetOpt(options.mEnableRealtimeLeakCheck, .EnableRealtimeLeakCheck);
SetOpt(options.mEnableSideStack, .EnableSideStack);
#if !CLI
SetOpt(options.mAllowHotSwapping, .EnableHotSwapping);

View file

@ -7180,13 +7180,12 @@ namespace IDE
// Only supported on Windows at the moment
bool hasLeakCheck = false;
#if BF_PLATFORM_WINDOWS
if (workspaceOptions.mEnableRealtimeLeakCheck && workspaceOptions.mEnableObjectDebugFlags)
if (workspaceOptions.LeakCheckingEnabled)
{
hasLeakCheck = true;
macroList.Add("BF_ENABLE_REALTIME_LEAK_CHECK");
}
#endif
if ((workspaceOptions.mAllocType == .Debug) || (hasLeakCheck))
macroList.Add("BF_DEBUG_ALLOC");

View file

@ -245,6 +245,18 @@ namespace IDE
delete configSel;
}
public bool LeakCheckingEnabled
{
get
{
#if BF_PLATFORM_WINDOWS
return mEnableRealtimeLeakCheck && mEnableObjectDebugFlags && (mAllocType == .Debug);
#else
return false;
#endif
}
}
public bool IsTestProject(Project project)
{
return ((mBuildKind == .Test) &&