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

buffer allocators #25

Closed
biasmv opened this issue Jan 18, 2014 · 0 comments
Closed

buffer allocators #25

biasmv opened this issue Jan 18, 2014 · 0 comments
Milestone

Comments

@biasmv
Copy link
Owner

biasmv commented Jan 18, 2014

Most of the render code uses buffer pools to manage typed arrays. The code also provides a fallback path for non-pooled allocation. That's bad as it requires manually checking for the presence of buffer pools:

 if (pool) {
  var array = pool.request(size); 
 } else {
   var array = new Float32Array(size); 
}

Instead, two types of allocators should be provided, one which just news the typed arrays, and another which uses a pool of buffers. The code simplifies to:

var array = allocator.request(size)
biasmv added a commit that referenced this issue Jan 24, 2014
The main motivation behind this change is to get rid of a few ifs.
Fixes issue #25
@biasmv biasmv closed this as completed Jan 24, 2014
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

1 participant