Rice
3.0.0
|
A guard to register a given address with the GC. More...
#include <Address_Registration_Guard_defn.hpp>
Public Member Functions | |
Address_Registration_Guard (VALUE *address) | |
Register an address with the GC. | |
Address_Registration_Guard (Object *object) | |
Register an Object with the GC. More... | |
~Address_Registration_Guard () | |
Unregister an address/Object with the GC. More... | |
VALUE * | address () const |
Get the address that is registered with the GC. | |
void | swap (Address_Registration_Guard &other) |
Swap with another Address_Registration_Guard. | |
Static Public Member Functions | |
static void | disable () |
A guard to register a given address with the GC.
Calls rb_gc_register_address upon construction and rb_gc_unregister_address upon destruction. For example:
Rice::Address_Registration_Guard::Address_Registration_Guard | ( | Object * | object | ) |
Register an Object with the GC.
object | The Object to register with the GC. The object must not be destroyed before the Address_Registration_Guard is destroyed. |
Rice::Address_Registration_Guard::~Address_Registration_Guard | ( | ) |
Unregister an address/Object with the GC.
Destruct an Address_Registration_Guard. The address registered with the Address_Registration_Guard when it was constructed will be unregistered from the GC.
|
static |
Called during Ruby's exit process since we should not call rb_gc unregister_address there