简体   繁体   中英

Raw array construction and access in Haxe

The std.Array in Haxe is not a raw array, but rather a managed one - it implements automatic grow and shrink mechanisms, etc. This is great for general use cases, but I need something closer to the metal, because I need greater control over it.

Something like Foo[] myFoos; instead of ArrayList<Foo> myFoos; in Java.

How do I do this in Haxe?


Details:

I tried looking in the implementation of std.Array to find this, to no avail - it is interface only. Would it be correct to assume that the actual implementation is in the OCaml compiler implementation?

取决于您的平台,本机数组以cpp.NativeArrayjava.NativeArraycs.NativeArrayjava.NativeArray cs.NativeArray 。如果要编译到多个目标,则应很容易地构建一个抽象来平滑这些类型之间的差异。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM