-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move log trimming from postscript to class method
...to avoid accessing the class variables through the classPool dictionary.
- Loading branch information
Showing
4 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
SquotTrackedObjectMetadata { | ||
#objectClassName : #PackageInfo, | ||
#id : UUID [ '9d2378120e641f4fad4dd02310c91f53' ], | ||
#slotOverrides : { }, | ||
#objectsReplacedByNames : true, | ||
#slotOverrides : { }, | ||
#serializer : #SquotCypressCodeSerializer | ||
} |
12 changes: 12 additions & 0 deletions
12
src/FileSystem-Git.package/GitStore.class/class/trimLog.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
internal | ||
trimLog | ||
"Fix too large log list due to a bug in the tally optimization from November 28, 2021. | ||
Original code was added by Christoph Thiede (ct) in the package postscript." | ||
"GitStore trimLog" | ||
| maxLogSize count | | ||
LogMessages ifNil: [^ self]. | ||
maxLogSize := 5000. | ||
(LogMutex ifNil: [LogMutex := Mutex new]) critical: | ||
[count := LogMessages size. | ||
LogMessages := (LogMessages asArray last: (count := count clampHigh: maxLogSize)) as: LinkedList. "forth and back conversion to avoid inefficient LinkedList(...)>>#last: (quadratic in older versions of Squeak)" | ||
LogMessageCount := count]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters