-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the PoolThreadCache finalizer to a separate object (#13510)
Motivation: PoolThreadCache objects are created even when they are not meant to pool anything. In such a case, there is no point in giving them a finalizer() method. Modification: The finalizer method is moved to a separate object, which is conditionally referenced from the PoolThreadCache. Non-pooling PoolThreadCache objects will not create their FreeOnFinalize objects. This is an alternative implementation to #13408, which is also reverted by this PR. Additionally, #13408 added a condition to create non-caching PoolThreadCache when the size of the small and normal caches were zero. However, it turned out that even when these were requested to be zero, a single-element cache would be created for them. This PR also reverts the logic to the old behaviour with the single-element cache for small and normal sizes. Result: We avoid creating finalizable objects when we don't pool.
- Loading branch information
Showing
9 changed files
with
71 additions
and
115 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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.