Ignore:
Timestamp:
Feb 24, 2016, 10:36:17 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, resolv-new, with_gc
Children:
ae7f1e0
Parents:
d41280e
Message:

intermediate implementation of vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/gc_no_raii/src/gcpointers.c

    rd41280e rc44e622  
    33#include "gc.h"
    44#include "internal/collector.h"
    5 #include "internal/object_header.h"
     5//#include "internal/object_header.h"
    66// #include "internal/state.h"
    7 
     7/*
    88void register_ptr(gcpointer_t* this)
    99{
    10         if(gcpointer_null(this)) return;
    11 
    12         _Bool managed = gc_is_managed(this);
    13 
    14         if(managed)
    15         {
    16                 gc_object_header* obj = gc_get_object_for_ref(gc_get_state(), (void*)this);
    17                 check(obj);
    18                 check(gc_obj_is_valide(obj));
    19                 check(gc_is_managed(this) == gc_is_managed(obj->type_chain) || obj->type_chain == NULL);
    20                 this->next = obj->type_chain;
    21                 obj->type_chain = this;
    22                 check(obj->is_valide());
    23         }
    24         else
    25         {
    26                 gc_object_header* obj = gc_get_object_ptr((void*)this->ptr);
    27                 check(obj);
    28                 check(gc_obj_is_valide(obj));
    29                 check(gc_is_managed(this) == gc_is_managed(obj->root_chain) || obj->root_chain == NULL);
    30                 this->next = obj->root_chain;
    31                 obj->root_chain = this;
    32                 check(gc_obj_is_valide(obj));
    33         }
     10        // if(gcpointer_null(this)) return;
     11        //
     12        // _Bool managed = gc_is_managed(this);
     13        //
     14        // if(managed)
     15        // {
     16        //      gc_object_header* obj = gc_get_object_for_ref(gc_get_state(), (void*)this);
     17        //      check(obj);
     18        //      check(gc_obj_is_valide(obj));
     19        //      check(gc_is_managed(this) == gc_is_managed(obj->type_chain) || obj->type_chain == NULL);
     20        //      this->next = obj->type_chain;
     21        //      obj->type_chain = this;
     22        //      check(obj->is_valide());
     23        // }
     24        // else
     25        // {
     26        //      gc_object_header* obj = gc_get_object_ptr((void*)this->ptr);
     27        //      check(obj);
     28        //      check(gc_obj_is_valide(obj));
     29        //      check(gc_is_managed(this) == gc_is_managed(obj->root_chain) || obj->root_chain == NULL);
     30        //      this->next = obj->root_chain;
     31        //      obj->root_chain = this;
     32        //      check(gc_obj_is_valide(obj));
     33        // }
    3434}
    3535
    3636void unregister_ptr(gcpointer_t* this)
    3737{
    38         if(gcpointer_null(this)) return;
    39 
    40         gcpointer_t** prev_next_ptr = gc_find_previous_ref(this);
    41         check((*prev_next_ptr) == this);
    42 
    43         (*prev_next_ptr) = this->next;
     38        // if(gcpointer_null(this)) return;
     39        //
     40        // gcpointer_t** prev_next_ptr = gc_find_previous_ref(this);
     41        // check((*prev_next_ptr) == this);
     42        //
     43        // (*prev_next_ptr) = this->next;
    4444}
    4545
     
    9999{
    100100        return this->ptr == (intptr_t)NULL;
    101 }
     101}*/
Note: See TracChangeset for help on using the changeset viewer.