User:Zachsaw/sandbox
Developer(s) | Zach Saw |
---|---|
Stable release | 1.1.0
/ November 26, 2012 |
Written in | C |
Operating system | Cross-platform C |
Type | Compilers |
License | GNU General Public License |
Website | http://managedcpp.sourceforge.net/ |
MCP (Managed C for GCC) is a GCC plugin and C framework that enables C programmers to use Microsoft C /CLI-like syntax for automatic garbage collection (GC) support. It uses Boehm GC in the same precise mode as GNU Java Compiler (GJC) and Mono, where objects and arrays have their pointers precisely traced[1]. In MCP, precisely traced objects and arrays are created via gcnew
and gcnew_array
operators respectively. MCP is free software and is licensed under the GPL license.
MCP consists of three parts - the GCC plugin (libmcp), the compiler replacement and the framework.
MCP's GCC plugin (libmcp) parses your source file for managed classes or structs and creates intermediate files containing information about the layout of the managed objects.
The compiler replacement (mcp) is a direct replacement for calling gcc/g to compile your C source files. It allows for easy IDE integration or replacing gcc/g with mcp as the compiler in Makefile.
The framework consists of APIs necessary to replicate C /CLI's GC features within the confines of C 0x / C 11. C /CLI specific language extensions such as Pointer^ and array^ with their respective allocator keywords (gcnew
and gcnew array
) are equivalent to MCP's gc_ptr
and gc_array
respectively. Another important template class, gcroot, is faithfully replicated in MCP, while GCHandle is replaced by a templated version.
C /CLI - MCP Equivalence Table
[edit]C /CLI | MCP |
---|---|
gcnew Foo() | gcnew (Foo)() |
gcnew array | gcnew_array |
References
[edit]- ^ "Mono's use of Boehm GC". Mono. Retrieved 2012-11-26.