1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00
denoland-deno/ext/node/ops/crypto
Divy Srivastava 28f64171cb
fix(node): use cppgc for managing X509Certificate (#21999)
Introduces the first cppgc backed Resource into Deno.

This fixes the memory leak when using `X509Certificate`

**Comparison**:

```js
import { X509Certificate } from 'node:crypto';

const r = Deno.readFileSync('cli/tests/node_compat/test/fixtures/keys/agent1-cert.pem');

setInterval(() => {
  for (let i = 0; i < 10000; i++) {
    const cert = new X509Certificate(r);
  }
}, 1000);
```

Memory usage after 5 secs

`main`: 1692MB
`cppgc`: peaks at 400MB
2024-01-20 21:58:37 +05:30
..
cipher.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
dh.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
digest.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
mod.rs chore: upgrade deno_core to 0.244.0 (#21859) 2024-01-09 17:25:10 +01:00
primes.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
x509.rs fix(node): use cppgc for managing X509Certificate (#21999) 2024-01-20 21:58:37 +05:30