Skip to Content.
Sympa Menu

internetworkers - Re: The list isn't blowing up yet?

internetworkers AT lists.ibiblio.org

Subject: Internetworkers: http://www.ibiblio.org/internetworkers/

List archive

Chronological Thread  
  • From: Michael S Czeiszperger <czei AT webperformanceinc.com>
  • To: "InterNetWorkers" <internetworkers AT franklin.oit.unc.edu>
  • Subject: Re: The list isn't blowing up yet?
  • Date: Fri, 7 Sep 2001 13:32:45 -0400


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 07 September 2001 01:23 pm, you wrote:
> Regarding the C# standards, isn't it following a similar model to that
> of Java and other products such as AppForge? The published plan is to
> allow for the Common Language Runtime (CLR) to be ported as necessary or
> desired to other platforms. This would allow code written in C# to run
> on other platforms. The JVM operates in a similar fashion does it not?
>

Both Java and C# allow native operating system calls to be made from within
the virtual machine. Those calls execute the actual compiled code for the
operating system, and are not executed by CLR bytecodes. In Java, the process
is discouraged for the obvious reason that it kills cross platform
capabilities; in C# it is encouraged for the same reason.

Here's sample C# code from the specification showing how easy it is to manage
your own Windows heap directly from C#:

// Frees a memory block.
public static void Free(void* block) {
if (!HeapFree(ph, 0, block)) throw new
InvalidOperationException();
}
// Re-allocates a memory block. If the reallocation request is for a
// larger size, the additional region of memory is automatically
// initialized to zero.
public static void* ReAlloc(void* block, int size) {
void* result = HeapReAlloc(ph, HEAP_ZERO_MEMORY, block, size);
if (result == null) throw new OutOfMemoryException();
return result;
}
// Returns the size of a memory block.
public static int SizeOf(void* block) {
int result = HeapSize(ph, 0, block);
if (result == -1) throw new InvalidOperationException();
return result;
}

This shows direct calls to WIN32 functions HeapFree(), HeapReAlloc(), and
HeapSize(). See, its easy and fun to make low level Windows calls from C#!

- --
Michael S Czeiszperger
czei AT webperformanceinc.com

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBO5kEvVgOl/a4Fw2AEQIjVACg4e22v6TQl4sHj/MXnnJoWVKuvC0AmQEr
un6Mp/JRK7Rl48//xVsAu5XP
=wCtv
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.24.

Top of Page