contiguous memory layout for javascript