Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for exact array sizes #5

Closed
mreinstein opened this issue May 24, 2017 · 3 comments
Closed

support for exact array sizes #5

mreinstein opened this issue May 24, 2017 · 3 comments

Comments

@mreinstein
Copy link

mreinstein commented May 24, 2017

some APIs will operate on an entire array, and the length needs to be exact. The adjusted API could look like:

var pool = require("typedarray-pool")

// Allocate a buffer of 93 bytes
var exactSize = true
var f = pool.malloc(93, "uint8", exactSize)

// f.byteLength === 93

// When done, release buffer
pool.free(f)

exactSize would default to false, to avoid breaking the existing API.

@mikolalysenko would you be open to a PR for this?

@mreinstein
Copy link
Author

I'm still keen to write this if there's a willingness to merge it

@mikolalysenko
Copy link
Owner

👍

@mreinstein
Copy link
Author

@mikolalysenko I have a PR that is just about ready for this, but I have several questions, which overlap some of the other issues in this tracker. Would you be available to chat on slack or some other more real-time medium? Probably faster than going back and forth in github messaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants