Skip to content

Commit

Permalink
Pooling
Browse files Browse the repository at this point in the history
  • Loading branch information
raulssorban committed Nov 13, 2024
1 parent 109b4db commit 401398e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Carbon.Core/Carbon.Components/Carbon.Bootstrap
5 changes: 3 additions & 2 deletions Carbon.Core/Carbon/src/Hooks/HookEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using API.Hooks;
using Carbon.Extensions;
using Carbon.Pooling;
using Facepunch;
using HarmonyLib;

/*
Expand Down Expand Up @@ -182,7 +183,7 @@ public bool ApplyPatch()
#if DEBUG
catch (HarmonyException e)
{
var sb = PoolEx.GetStringBuilder();
var sb = Pool.Get<StringBuilder>();
Logger.Error($"Error while patching hook '{this}' index:{e.GetErrorIndex()} offset:{e.GetErrorOffset()}", e);
sb.AppendLine($"{e.InnerException?.Message.Trim() ?? string.Empty}");

Expand All @@ -191,7 +192,7 @@ public bool ApplyPatch()
sb.AppendLine($"\t{x++:000} {instruction.Key:X4}: {instruction.Value}");

Logger.Error(sb.ToString());
PoolEx.FreeStringBuilder(ref sb);
Pool.FreeUnmanaged(ref sb);
return false;
}
#endif
Expand Down

0 comments on commit 401398e

Please sign in to comment.