Created
February 12, 2015 07:47
-
-
Save triplefox/6385d0b64904780f8692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
Array32Part{.unchecked.} = array[0..0, float32] | |
Buffer32 = ref object | |
samples: int | |
bytes: int | |
data: ptr Array32Part | |
proc AllocBuffer32(samples : int): Buffer32 = | |
let bytes = samples * (sizeof(float32)) | |
Buffer32(samples: samples, bytes : bytes, data: cast[ptr Array32Part](alloc0(bytes))) | |
proc DeallocBuffer32(b : Buffer32) = | |
dealloc(cast[pointer](b.data)) | |
var buffer:Buffer32 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment