Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Precise mode in Boehm GC under Mono isn't just <code>GC_MALLOC_ATOMIC</code>. It's only true for arrays of fundamental types.</p> <p>For managed types, <code>GC_gcj_malloc</code> is used. Mono's compiler generates an object descriptor for every managed type and it then simply calls <code>GC_gcj_malloc</code> with an argument of size, and a pointer to the managed type's descriptor. Boehm GC then refers to the descriptor during mark phase to trace the managed pointers.</p> <p>You will end up with just the root pointers sitting on the stack as raw pointers (<code>GC_gcj_malloc</code> returns a void* and there's no way to tell the GC where the pointers are on the stack via some sort of a stack descriptor prior to GC collect). This is the reason Mono (prior to SGen) says they scan the stack in conservative mode.</p> <p>If you want to implement this under C++, you won't be able to simply rely on the C++ compiler to generate the object descriptor for you. What I envisioned a long time ago was to write an intermediate compiler that parses all your C++ header files for class definitions that have been marked as managed class (e.g. <code>_ref class MyManagedObject</code> where <code>_ref</code> is simply a <code>#define</code> to nothing) and generate a header file containing those object descriptors. You would then use the <code>GC_make_descriptor</code> and <code>GC_malloc_explicitly_typed</code> functions to allocate your objects in precise mode rather than <code>GC_gcj_malloc</code> as you would not have control over how your C++ compiler allocates its vtable.</p> <p>*EDIT: See <a href="http://managedcpp.sourceforge.net" rel="nofollow">Managed C++ for GCC (open source GPL v3)</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload