PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

_alloca broken?

I just ran into this behavior during debugging and was wondering if anybody else ran into similar issues or would know when this occurs:

I am using _alloca to allocate temporary arrays. The code works fine in VS.net and in eVC 4 when running in the emulator. When I execute on the ARM device though, addressing of local variables seems to be corrupted (I am stepping through the assembly code and indeed, it's loading from the wrong location).

Obviously malloc/free is a work-around, but _alloca would definitively be the preferred solution for performance reasons.

So, anybody seen this before? Is there a known pattern what kind of code triggers this? What I noticed is that the code generated for _alloca does not enforce proper alignment, but that seems to be unrelated to the problem I am seeing.

Thanks,
HM
_alloca is unsupported in Windows CE 3.0. It may be available in the .NET compact framework, I have not checked, but that could relate to your ability to test it on a PC successfully. You'll have to use more traditional methods of memory management I'm afraid.


JJB
JongJungBu wrote:_alloca is unsupported in Windows CE 3.0. It may be available in the .NET compact framework, I have not checked, but that could relate to your ability to test it on a PC successfully.
JJB

Thanks, yes, that is consistent. So they just did not remove all the traces in their documentation.
Yeah, I checked through some of the various PPC SDKs, and .net and platform SDKs. It seems to vary from one to the next on whether its actually documented as unsupported for CE.

JJB