Created
February 12, 2015 08:24
-
-
Save Deco/850e3e8f05cb0495588a to your computer and use it in GitHub Desktop.
This file contains 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
{.experimental.} | |
import sequtils, unittest as unittest | |
type arrayUnchecked {.unchecked.} [T] = array[0..0, T] | |
type memory[T] = ptr arrayUnchecked[T] | |
let intCount = 10 | |
let floatCount = 20 | |
let memoryBlockPtr = alloc0(intCount*sizeof(int) + floatCount*sizeof(float32)) | |
let intArray = cast[memory[int]](memoryBlockPtr) | |
let floatArray = cast[memory[float32]]( ??? ) # help | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment