Marshaling – what is it and why do we need it?

后端 未结 6 1776
抹茶落季
抹茶落季 2020-12-12 12:14

What is marshalling and why do we need it?

I find it hard to believe that I cannot send an int over the wire from C# to C and have to marshall it. Why c

6条回答
  •  心在旅途
    2020-12-12 12:23

    .NET code(C#, VB) is called "managed" because it's "managed" by CLR (Common Language Runtime)

    If you write code in C or C++ or assembler it is all called "unmanaged", since no CLR is involved. You are responsible for all memory allocation/de-allocation.

    Marshaling is the process between managed code and unmanaged code; It is one of the most important services offered by the CLR.

提交回复
热议问题