Cables

Cables

Cables, buffers, stacks, and pools. These are what Graforge uses under the hood to efficiently copy data. In the wrong hands, it can be quite a footgun!

Notes and noodling for now. Will write more later.

Some under-the-hood talk

TODO bhold/bunhold

TODO cabset/cabget

TODO cabclr

TODO cabnew

Allocates a cable with a new buffer.

cabtmp

Like cabnew, but it will first try to get a buffer from the pool before allocating a buffer as a last resort.

Here is a stress test that demonstrates this.

graforge nodes

# use up all 8 buffers (default pool size)

440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp
440 0.5 sine cabtmp

# this one allocates a buffer
440 0.5 sine cabtmp