>
>
>
> Generally solving this involves more than just fixed-size arrays, it
> requires run-time specified sizes for a fixed-size-array which doesn't
> cause code-re-instantiation. Without any field-position-indirection, I
> think this can provably only be done for a single fixed-size-array
> (appended at the end of the struct). Anything else would require either
> field-location indirection, or per-size code-instantiation. I think a
> general runtime mechanism for this would have to accept that a struct can
> only have a single runtime-variable sized array like this, and to do so it
> must be a sealed (non-derivable) class.
>
Id settle for a custom method just for faststring ..its pretty rare..
>
>
> Fixed is not supported in classes , while there is no practical reason as
>> Shap has said what does fixed offer over [MarshalAs(UnmanagedType.
>> ByValArray, SizeConst = 128)] which can be used on classes and
>> generates this CIL .field public marshal(fixed array[128]) char[]
>> fixedBuffer ?
>
>
> "unsafe fixed char fixedBufferA[128];" allows you to embed multiple
> fixed-size arrays in a single contiguous and cache-efficient
> value-type-record. Your ".field public marshal(...) char[] fixedBuffer" is
> a reference type array pointed to by the class, located somewhere else in
> memory.
>
I use this marshal all the time for interop of C arrays embeded in structs
so i dont think its a pointer to an array ..
eg in C and then i pass the pointer to the struct .
struct data
{
int header;
char fixedBuffer128];
}
Ben
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev