Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm] Bypass malloc for large Zone allocations to avoid jemalloc leaks.
Revert 9a07ad8. Bug: flutter/flutter#29007 Change-Id: I6a5f51f0c3a54d354ec5f8495677d46f94d8a1d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100568 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
- Loading branch information
1 parent
a7325f9
commit 347b72c
Showing
8 changed files
with
151 additions
and
38 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
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
24 changes: 24 additions & 0 deletions
24
tests/corelib_2/regexp/jemalloc_leak_backtracking_stack_test.dart
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,24 @@ | |||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |||
// for details. All rights reserved. Use of this source code is governed by a | |||
// BSD-style license that can be found in the LICENSE file. | |||
|
|||
// Regression test for https://github.com/flutter/flutter/issues/29007 | |||
|
|||
String escape(String string) { | |||
var regex = new RegExp("(\\?|\\\$|\\*|\\(|\\)|\\[)|\\+|\\.|\\\\"); | |||
return string.replaceAllMapped( | |||
regex, (Match m) => "\\" + string.substring(m.start, m.end)); | |||
} | |||
|
|||
main() { | |||
var text = """ | |||
Yet but three? Come one more. | |||
Two of both kinds make up four. | |||
"""; | |||
var accumulate = 0; | |||
for (var i = 0; i < 65536; i++) { | |||
accumulate += escape(text).length; | |||
} | |||
|
|||
print(accumulate); | |||
} |