Skip to content

Commit

Permalink
Common++
Browse files Browse the repository at this point in the history
  • Loading branch information
raulssorban committed Apr 8, 2024
1 parent 4577abe commit a26118e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Carbon.Core/Carbon/src/Hooks/HookCallerInternal.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Carbon.Base;
using Carbon.Components;
using Carbon.Extensions;
using Carbon.Pooling;
using Facepunch;
using Oxide.Core.Plugins;
using UnityEngine;
using static Carbon.Base.BaseHookable;

/*
Expand Down Expand Up @@ -128,7 +130,7 @@ public override object CallHook<T>(T hookable, uint hookId, BindingFlags flags,
#endif

hookable.TrackStart();
var beforeMemory = hookable.TotalMemoryUsed;
var beforeMemory = CurrentMemory;

if (hook != null && hook.IsAsync)
{
Expand All @@ -147,8 +149,8 @@ public override object CallHook<T>(T hookable, uint hookId, BindingFlags flags,
}

var afterHookTime = hookable.CurrentHookTime;
var afterMemory = hookable.TotalMemoryUsed;
var totalMemory = afterMemory - beforeMemory;
var afterMemory = CurrentMemory;
var totalMemory = Mathf.Abs(afterMemory - beforeMemory);

#if DEBUG
Profiler.EndHookCall(hookable);
Expand Down

0 comments on commit a26118e

Please sign in to comment.