[#BloombergLP-bslma-TestAllocator-restoreStatistics]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/TestAllocator.adoc[TestAllocator]::restoreStatistics
:relfileprefix: ../../../
:mrdocs:

Restore statistics previously saved by `stashStatistics`&period;

== Synopsis

Declared in `&lt;bslma&lowbar;testallocator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
restoreStatistics(xref:BloombergLP/bslma/TestAllocatorStashedStatistics.adoc[TestAllocatorStashedStatistics]* savedStatistics);
----

== Description

Restore the statistics from the specified `savedStatistics` by appropriately combining the current values and the saved values&period; The behavior is undefined unless `savedStatistics` is a value returned by a previous call to `stashStatictics` on this same object, which has not been passed to `restoreStatistics` yet&period; This method restores the state of the statistics as if the corresponding `stashStatistics` call has never happened, in the following manner&colon;

Statistic &verbar; Restore value as &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &verbar; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; numAllocations &verbar; saved &plus; current &hyphen; saved&period;numBlocksInUse numDeallocations &verbar; saved&period;numDeallocations &plus; current&period;numDeallocations numMismatches &verbar; saved&period;numMismatches &plus; current&period;numMismatches numBoundsErrors &verbar; saved&period;numBoundsErrors &plus; current&period;numBoundsErrors numBlocksMax &verbar; max(saved&period;numBlocksMax, current&period;numBlocksMax) numBytesMax &verbar; max(saved&period;numBytesMax, current&period;numBytesMax) numBlocksTotal &verbar; saved &plus; current &hyphen; saved&period;numBlocksInUse numBytesTotal &verbar; saved &plus; current &hyphen; saved&period;numBytesInUse

See also `stashStatistics`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *savedStatistics*
| Statistics previously returned by `stashStatistics`&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
