Changeset 6be0cf9 for src/examples/gc_no_raii/src/gcpointers.c
- Timestamp:
- Jan 19, 2016, 4:07:06 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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, qualifiedEnum, resolv-new, with_gc
- Children:
- 08a40fd
- Parents:
- a2b2761
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/src/gcpointers.c
ra2b2761 r6be0cf9 4 4 #include "internal/collector.h" 5 5 #include "internal/object_header.h" 6 #include "internal/state.h"6 // #include "internal/state.h" 7 7 8 8 void register_ptr(gcpointer_t* this) … … 14 14 if(managed) 15 15 { 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); 17 17 check(obj); 18 18 check(gc_obj_is_valide(obj)); 19 19 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; 21 21 obj->type_chain = this; 22 22 check(obj->is_valide()); … … 24 24 else 25 25 { 26 gc_object_header* obj = gc_get_object_ptr( this->ptr);26 gc_object_header* obj = gc_get_object_ptr((void*)this->ptr); 27 27 check(obj); 28 28 check(gc_obj_is_valide(obj)); 29 29 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; 31 31 obj->root_chain = this; 32 32 check(gc_obj_is_valide(obj)); … … 46 46 void gcpointer_ctor(gcpointer_t* this) 47 47 { 48 this->ptr = NULL;48 this->ptr = (intptr_t)NULL; 49 49 this->next = NULL; 50 50 } … … 52 52 void gcpointer_ctor(gcpointer_t* this, void* address) 53 53 { 54 this->ptr = address;54 this->ptr = (intptr_t)address; 55 55 this->next = NULL; 56 56 … … 73 73 gcpointer_t* gcpointer_assign(gcpointer_t* this, gcpointer_t* rhs) 74 74 { 75 if(this != rhs && this->ptr != rhs->ptr)75 if(this != rhs) 76 76 { 77 77 unregister_ptr(this); … … 98 98 int gcpointer_null(gcpointer_t* this) 99 99 { 100 return this->ptr == NULL;100 return this->ptr == (intptr_t)NULL; 101 101 }
Note: See TracChangeset
for help on using the changeset viewer.