A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mikolalysenko/typedarray-pool below:

GitHub - mikolalysenko/typedarray-pool: Reuse typed arrays

A global pool for typed arrays.

var pool = require("typedarray-pool")

//Allocate a buffer with at least 128 floats
var f = pool.malloc(128, "float")

// ... do stuff ...

//When done, release buffer
pool.free(f)
npm install typedarray-pool
var pool = require("typedarray-pool")

Allocates a typed array (or ArrayBuffer) with at least n elements.

Returns A typed array with at least n elements in it. If dtype is undefined, an ArrayBuffer is returned.

Note You can avoid the dispatch by directly calling one of the following methods:

Returns the array back to the pool.

Note You can speed up the method if you know the type of array before hand by calling one of the following:

Removes all references to cached arrays. Use this when you are done with the pool to return all the cached memory to the garbage collector.

(c) 2014 Mikola Lysenko. MIT License


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4