Hacker News new | ask | show | jobs
by raincole 14 days ago
In C# (and generally in programming) marshaling is the conversion between your typical memory representation (in C# it's your object) and the other ways (be it C struct, C string, utf8 string, or whatever received from socket.) that's why AllocGlobal is under Marshal. Not saying one should use it though... the only ones sane programmers would touch is probably to handle C structs returned from native code.
1 comments

System.Marshal is a sort of catch-all for functions used to interact with unmanaged code, including things like Win32 error handling and COM in addtion to type conversion and unsafe memory access in general.