Substring.FlushThreadCache Method

class procedure FlushThreadCache; static;

Returns the memory the calling thread keeps for reuse to the memory manager.

Result: stored in self (calling object)

Remarks:

For a thread that is done with long texts for a while; texts still in use keep theirs.

Examples

An empty cache after the flush.

uses Substr;

procedure Example;
begin
    Substring.FlushThreadCache;
    Assert(Substring.ThreadStats.CachedBlocks = 0);
end;