Using SSC or SPI with high data rates

wow, perfect.
Just found a note, that it is not allowed to store data pointers in RLP domain, cause the GC will rearrange the memory.

But as there is a possibility to pin down some memory area, I can do as I done before, ring-buffer and here we go. Same as your solution, only with the ability to have more than one buffer, if needed.

Thanks for that important Input.

With best regards

Gerhard

@ Gerhard - if you use the InvokeEx method to call a native function, and pass the buffer as the first parameter, the buffer will be passed as a pointer, and not copied. This pointer will still be valid after the native function returns control to managed code. This only works if the managed buffer is allocated as a static byte buffer.

Static variables are not garbage collected in .Net.

http://social.msdn.microsoft.com/Forums/en-US/ed05d414-9864-4093-b200-67dede4b46e1/garbage-collection-and-static-classes

See my RLP music driver in Code Share:

https://www.ghielectronics.com/community/codeshare/entry/805

@ jasdev - are you sure that compaction will not move the buffer?

@ Gus - No, I’m not 100% sure. I’ve not been able to find a definitive answer from Microsoft. However, I did find other sources that seem to confirm that this is true, and I tested my RLP music driver for many hours, and never encountered an error due to the buffer being moved.