-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Stephan T. Lavavej <[email protected]>
- Loading branch information
1 parent
03d73df
commit 99cdfa8
Showing
4 changed files
with
35 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
RUNALL_INCLUDE ..\usual_20_matrix.lst |
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,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
// REQUIRES: debug_CRT | ||
|
||
#include <cassert> | ||
#include <cstdlib> | ||
#include <sstream> | ||
#include <syncstream> | ||
using namespace std; | ||
|
||
// GH-2760, <syncstream>: std::osyncstream memory leak | ||
int main() { | ||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | ||
[[maybe_unused]] _CrtMemState start; | ||
[[maybe_unused]] _CrtMemState end; | ||
[[maybe_unused]] _CrtMemState diff; | ||
_CrtMemCheckpoint(&start); | ||
{ | ||
stringstream s; | ||
osyncstream bout(s); | ||
bout << "Hello, this line is long, which previously leaked memory" << '\n'; | ||
} | ||
_CrtMemCheckpoint(&end); | ||
assert(_CrtMemDifference(&diff, &start, &end) == 0); | ||
} |