Ignore:
Timestamp:
Jan 19, 2016, 4:07:06 PM (7 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:
08a40fd
Parents:
a2b2761
Message:

gcpointers.c compiles

File:
1 edited

Legend:

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

    ra2b2761 r6be0cf9  
    44#include "internal/collector.h"
    55#include "internal/object_header.h"
    6 #include "internal/state.h"
     6// #include "internal/state.h"
    77
    88void register_ptr(gcpointer_t* this)
     
    1414        if(managed)
    1515        {
    16                 gc_object_header* obj = gc_get_object_for_ref(this);
     16                gc_object_header* obj = gc_get_object_for_ref(gc_get_state(), (void*)this);
    1717                check(obj);
    1818                check(gc_obj_is_valide(obj));
    1919                check(gc_is_managed(this) == gc_is_managed(obj->type_chain) || obj->type_chain == NULL);
    20                 m_next = obj->type_chain;
     20                this->next = obj->type_chain;
    2121                obj->type_chain = this;
    2222                check(obj->is_valide());
     
    2424        else
    2525        {
    26                 gc_object_header* obj = gc_get_object_ptr(this->ptr);
     26                gc_object_header* obj = gc_get_object_ptr((void*)this->ptr);
    2727                check(obj);
    2828                check(gc_obj_is_valide(obj));
    2929                check(gc_is_managed(this) == gc_is_managed(obj->root_chain) || obj->root_chain == NULL);
    30                 m_next = obj->root_chain;
     30                this->next = obj->root_chain;
    3131                obj->root_chain = this;
    3232                check(gc_obj_is_valide(obj));
     
    4646void gcpointer_ctor(gcpointer_t* this)
    4747{
    48         this->ptr = NULL;
     48        this->ptr = (intptr_t)NULL;
    4949        this->next = NULL;
    5050}
     
    5252void gcpointer_ctor(gcpointer_t* this, void* address)
    5353{
    54         this->ptr = address;
     54        this->ptr = (intptr_t)address;
    5555        this->next = NULL;
    5656
     
    7373gcpointer_t* gcpointer_assign(gcpointer_t* this, gcpointer_t* rhs)
    7474{
    75         if(this != rhs && this->ptr != rhs->ptr)
     75        if(this != rhs)
    7676        {
    7777                unregister_ptr(this);
     
    9898int gcpointer_null(gcpointer_t* this)
    9999{
    100         return this->ptr == NULL;
     100        return this->ptr == (intptr_t)NULL;
    101101}
Note: See TracChangeset for help on using the changeset viewer.