Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typedarray-pool

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedarray-pool

Reuse typed arrays

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80K
decreased by-63.85%
Maintainers
1
Weekly downloads
 
Created

What is typedarray-pool?

The 'typedarray-pool' npm package provides efficient memory management for typed arrays by reusing and recycling them. This can help reduce garbage collection overhead and improve performance in applications that frequently allocate and deallocate typed arrays.

What are typedarray-pool's main functionalities?

Allocate a Typed Array

This feature allows you to allocate a new typed array from the pool. The 'mallocFloat32' function allocates a Float32Array of the specified length (10 in this case).

const pool = require('typedarray-pool');
const array = pool.mallocFloat32(10);

Free a Typed Array

This feature allows you to return a typed array back to the pool for reuse. The 'free' function takes the typed array and makes it available for future allocations.

pool.free(array);

Reallocate a Typed Array

This feature allows you to allocate a new typed array with a different size. The 'mallocFloat32' function can be called again with a different length (20 in this case) to get a new array.

const newArray = pool.mallocFloat32(20);

Other packages similar to typedarray-pool

Keywords

FAQs

Package last updated on 14 May 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc