src/share/vm/classfile/symbolTable.hpp

changeset 3969
1d7922586cf6
parent 3904
ace99a6ffc83
child 4037
da91efe96a93
equal deleted inserted replaced
3944:aba91a731143 3969:1d7922586cf6
55 // Creating or looking up a symbol increments the symbol's reference count 55 // Creating or looking up a symbol increments the symbol's reference count
56 TempNewSymbol(Symbol *s) : _temp(s) {} 56 TempNewSymbol(Symbol *s) : _temp(s) {}
57 57
58 // Operator= increments reference count. 58 // Operator= increments reference count.
59 void operator=(const TempNewSymbol &s) { 59 void operator=(const TempNewSymbol &s) {
60 //clear(); //FIXME
60 _temp = s._temp; 61 _temp = s._temp;
61 if (_temp !=NULL) _temp->increment_refcount(); 62 if (_temp !=NULL) _temp->increment_refcount();
62 } 63 }
63 64
64 // Decrement reference counter so it can go away if it's unique 65 // Decrement reference counter so it can go away if it's unique
65 ~TempNewSymbol() { if (_temp != NULL) _temp->decrement_refcount(); } 66 void clear() { if (_temp != NULL) _temp->decrement_refcount(); _temp = NULL; }
67
68 ~TempNewSymbol() { clear(); }
66 69
67 // Operators so they can be used like Symbols 70 // Operators so they can be used like Symbols
68 Symbol* operator -> () const { return _temp; } 71 Symbol* operator -> () const { return _temp; }
69 bool operator == (Symbol* o) const { return _temp == o; } 72 bool operator == (Symbol* o) const { return _temp == o; }
70 // Sneaky conversion function 73 // Sneaky conversion function

mercurial