-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the responsibility for calling
Chain::EnsureHasHere()
(dealloc…
…ating the block pointer array before writing inline data) from functions calling `Chain::Initialize()` to `Chain::Initialize()` functions themselves. This frees the block pointer array only when writing inline data, not when block pointers are needed again, reusing the allocation of the block pointer array, at the cost of a redundant comparison in constructors where blocks are definitely not allocated, and retaining memory for the block pointer array. This fixes `Chain::operator=(const Chain&)` when allocated block pointers are being replaced with inline data: `Chain::EnsureHasHere()` was missing. Add assertions about preconditions of `Chain::Initialize()`. PiperOrigin-RevId: 653193048
- Loading branch information
Showing
3 changed files
with
53 additions
and
27 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 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