.NET Micro Framework Unsafe code
Asked Answered
E

2

2

Does .NET Micro Framework support unsafe code? In other words, can I use pointers in my code for .NET Micro Framework?

Enwomb answered 20/8, 2009 at 15:33 Comment(0)
Z
3

From the Wikipedia page (emphasis mine):

For example, the platform does not support symmetric multiprocessing, multi-dimensional arrays, machine-dependent types, or unsafe instructions.

The technical white paper lists it in the omitted features too.

Zinn answered 20/8, 2009 at 15:36 Comment(5)
@MarcGravell: Thanks, changed it to a scribd one.Zinn
Although this is an ancient question (in SO time), I have added an answer which shows that the unsafe keyword apparently works at present, although it remains a documented "unsupported" feature.Absorptivity
@nicholas: I suspect it was introduced in a later version.Zinn
possibly. i can find no documentation stating that it is a supported feature (or unsupported for that matter). hard to say when it was addedAbsorptivity
While it works it's rather unreliable, even in 4.3 For example [var result = *(((short*)numRef));] will retrieve 2 bytes on the desktop but only one on the micro framework. We found that out the hard way ...Kenway
A
1

Although officially not supported, I have personally used and tested unsafe code in NETMF 4.2 and find that it works as expected.

Another developer provides sample code for implementing a BitConverter class on NETMF doing just this:

http://forums.netduino.com/index.php?/topic/308-bitconverter/

Absorptivity answered 16/4, 2013 at 15:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.