Socket
Socket
Sign inDemoInstall

@mlabs-haskell/csl-gc-wrapper

Package Overview
Dependencies
0
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mlabs-haskell/csl-gc-wrapper

A small library that provides a wrapper for managing garbage collection for cardano-serialization-library, used in https://github.com/mlabs-haskell/cardano-serialization-lib-gc


Version published
Weekly downloads
61
decreased by-32.97%
Maintainers
6
Install size
2.60 kB
Created
Weekly downloads
 

Readme

Source

csl-gc-wrapper

This is a small library that provides a wrapper for managing garbage collection for cardano-serialization-library. It does this by using a FinalizationRegistry object to keep track of objects that are no longer in use, and calling the free() method on them when they are finalized.

Example usage:

const csl = require("@emurgo/cardano-serialization-lib-browser");
const wrappedCsl = require('@mlabs-haskell/csl-gc-wrapper')(csl)

function fixture() {
  const arr = new Uint8Array(Array(10000000).fill(0));
  const pd = lib.PlutusData.new_bytes(arr);
}

setInterval(() => {
  for (let i = 0; i < 10; i++) {
    fixture()
  }
}, 500) // gc will trigger proxies and underlying pointers

FAQs

Last updated on 12 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc