Help for this page

Select Code to Download


  1. or download this
    // should NOT alter refcount
    Node* set_parent(Node* self, Node* parent) {
        self->parent = parent;
        return self;
    }
    
  2. or download this
    void set_parent(Node* self, Node* parent) {
        self->parent = parent;
    }
    
  3. or download this
    #!perl -l
    use warnings;
    ...
    
    print "x: $x";
    print "y: $y";
    
  4. or download this
    x refcnt: 2
    x refcnt: 1
    ...
    Use of uninitialized value $x in concatenation (.) or string at try.pl
    + line 31.
    x:
    y: 42
    
  5. or download this
    Node* get_parent(Node* self) {
       SvREFCNT_inc(self->parent);
       return self->parent;
    }
    
  6. or download this
    NODE: SV = IV(0x2c22740) at 0x2c22744
      REFCNT = 1
    ...
    ---
    destroying Node=SCALAR(0x45807c) at rut.pl line 58.
    destroying Node=SCALAR(0x45812c) at rut.pl line 58.
    
  7. or download this
    void destroy_node(Node* self) {
         Safefree(self->parent);
         Safefree(self);
    }