Pointer to String chars – Everett style

Garrett asked: If the source text is in a CLR String, and we want to pass(even read-only) to unmanaged code, it appears that there is no way to get a pointer to the String’s buffer directly. We have to use the marshalling stuff to get it there, which in itself makes a copy. Given that…

9

The native heap/managed heap barrier

Garrett asks: You mentioned: class A{}; array^ arr = gcnew array(10);. Are you saying that whidbey will support this? What is it doing to the native pointer? Boxing? Managed array of native pointers to native objects?  This didn’t work in Everett, but it will in Whidbey.  It probably wasn’t a hard fix.  Let’s look a…

2

Clarifications on the array template, and some about the CLR namespaces

Garrett returns with some observations: Damn Cool. My only reservation is that it doens’t *resemble* a native array, but that’s ok too 🙂   In some ways that is far better than the alternative. I was never quite thrilled about the cryptic nature of managed arrays before. Yeah, us either.  That’s why we did it. 🙂…

1

Why you ought not pre-jit, and why it sometimes makes sense.

So, Raj asks: Thanks for the explanation but what is the deal with the IL and JIT. Why not just prejit the code? Why not pre-jit the code? Class, you didn’t do the required reading. 🙂  Actually, there are a couple of optimization reasons why you don’t pre-jit code.  Most of it deals with this basic tenet: the…

0

Dave strikes again, a basic description of how .NET works.

Dave asks: i have tried some UI examples in the book, but it was quite slow. when I execute the program, it takes 1.5-2seconds to see the window on the screen, on the other hand plain win32 api creates window before 1st second. doesn’t .net generate native win32 binary code? what does it load/do delaying…

2

The array template

Some background.  In Managed Extensions, the CLI Array was exposed using the keyword __gc[].  If you wanted a CLI array of, say, ten ints named arr, you did: int arr __gc[] = new int __gc[10];.  Then, access into the array worked much like native arrays.  If I wanted the fifth element, I did arr[4].  (C++…

4

A little Q&A

Reader Dave asks: I am using Visual Studio 7.0 (2002?). I turn on my computer in the morning, and run it until midnight and my visual studio is always open. however, it consumes 60-150MB Virtual memory, specifically when i use VisualPerl (I usually use Visual C++). sometimes i need to run two instances of visual…

2

C++/CLI operators

A bit of background.  You may recall CLI operators in Managed Extensions: op_Equality, op_Addition, … so on and so forth.  To be sure, not the friendliest set of operators ever, as you had to remember what their names were in order to overload them. How is it different in Whidbey?  We’re leveraging the existing C++ operator…

0

Mono, more on cross-platform

Mono (very different from mono), is, at its core, an implementation of the Common Language Specification – which we purposefully made public domain through ECMA.  Mono is pretty cool, too, and I’m personally glad to see it.  They even praise the standard Microsoft helped develop: The Common Language Infrastructure platform is similar to the goals we…

4