Skip to content

Instantly share code, notes, and snippets.

@hotsphink
Created July 2, 2019 21:47
Show Gist options
  • Save hotsphink/8037d5eac463cf748440f1f84efe6570 to your computer and use it in GitHub Desktop.
Save hotsphink/8037d5eac463cf748440f1f84efe6570 to your computer and use it in GitHub Desktop.
mkgist-created gist
function makeExtensibleString() {
var s = "xxxxxxxx";
var t = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 31 characters
var r1 = t + s;
r1.match(/x/);
return r1;
}
function test() {
const s = makeExtensibleString();
const r = s + (s + s);
// print(r);
dumpStringRepresentation(r);
print(" ----- minor GC -------");
minorgc();
r.match(/x/);
// print(r);
dumpStringRepresentation(r);
}
test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment