Commit 41a3fbb
authored
StaticLogMessage isn't pooling correctly (#78652)
Noticed this when looking at a profile and was curious why there were 3
MB of allocations of the StaticLogMessage type.
LogMessage.Free sets _message to null before calling FreeCore, thus
StaticLogMessage.FreeCore was never adding items back to it's pool. The
ordering of LogMessage setting _message to null and calling FreeCore is
important, so that can't be changed. Instead, add a flag to
StaticLogMessage to indicate whether it's in a constructed state or not.
File tree
1 file changed
+5
-1
lines changed1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
0 commit comments