leonardchan added inline comments.

================
Comment at: llvm/lib/Support/Compression.cpp:30-32
+ZStdCompressionAlgorithm
+    *llvm::compression::ZStdCompressionAlgorithm::Instance =
+        new ZStdCompressionAlgorithm();
----------------
Perhaps for each of these, you could instead have something like:

```
ZStdCompressionAlgorithm *getZStdCompressionAlgorithm() {
  static ZStdCompressionAlgorithm* instance = new ZStdCompressionAlgorithm;
  return instance;
}
```

This way the instances are only new'd when they're actually used.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130516/new/

https://reviews.llvm.org/D130516

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to