Skip to content

Commit

Permalink
so much lint
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Dec 11, 2024
1 parent fba2601 commit f03a935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions OpenDreamRuntime/Objects/DreamObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public DreamObject(DreamObjectDefinition objectDefinition) {
ObjectDefinition.DreamManager.Datums.AddLast(new WeakDreamRef(this));
}
#if TOOLS
if(_tracyMemoryId is null) //if it's not null, subclasses have done their own allocation
_tracyMemoryId = Profiler.BeginMemoryZone((ulong)(Unsafe.SizeOf<DreamObject>() + ObjectDefinition.Variables.Count * Unsafe.SizeOf<DreamValue>() ), "/datum");
//if it's not null, subclasses have done their own allocation
_tracyMemoryId ??= Profiler.BeginMemoryZone((ulong)(Unsafe.SizeOf<DreamObject>() + ObjectDefinition.Variables.Count * Unsafe.SizeOf<DreamValue>() ), "/datum");
#endif
}

Expand Down
7 changes: 3 additions & 4 deletions OpenDreamRuntime/Profile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
using System.Threading;
using bottlenoselabs.C2CS.Runtime;
using static Tracy.PInvoke;
Expand All @@ -8,7 +7,7 @@ namespace OpenDreamRuntime;

public static class Profiler{
//internal tracking for unique IDs for memory zones, because we can't use actual object pointers sadly as they are unstable outside of `unsafe`
private static UInt64 _memoryUID = 0;
private static ulong _memoryUid;

// Plot names need to be cached for the lifetime of the program
// seealso Tracy docs section 3.1
Expand Down Expand Up @@ -73,7 +72,7 @@ public static class Profiler{
#else
var namestr = name is null ? GetPlotCString("null") : GetPlotCString(name);
unsafe {
return new ProfilerMemory((void*)(Interlocked.Add(ref _memoryUID, size)-size), size, namestr);
return new ProfilerMemory((void*)(Interlocked.Add(ref _memoryUid, size)-size), size, namestr);
}
#endif
}
Expand Down

0 comments on commit f03a935

Please sign in to comment.