OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 #ifndef NDEBUG | 228 #ifndef NDEBUG |
229 TraceTrait<T>::checkTypeMarker(this, t); | 229 TraceTrait<T>::checkTypeMarker(this, t); |
230 #endif | 230 #endif |
231 TraceTrait<T>::mark(this, t); | 231 TraceTrait<T>::mark(this, t); |
232 } | 232 } |
233 | 233 |
234 // Member version of the one-argument templated trace method. | 234 // Member version of the one-argument templated trace method. |
235 template<typename T> | 235 template<typename T> |
236 void trace(const Member<T>& t) | 236 void trace(const Member<T>& t) |
237 { | 237 { |
238 mark(t.raw()); | 238 mark(t.get()); |
239 } | 239 } |
240 | 240 |
241 // WeakMember version of the templated trace method. It doesn't keep | 241 // WeakMember version of the templated trace method. It doesn't keep |
242 // the traced thing alive, but will write null to the WeakMember later | 242 // the traced thing alive, but will write null to the WeakMember later |
243 // if the pointed-to object is dead. | 243 // if the pointed-to object is dead. |
244 template<typename T> | 244 template<typename T> |
245 void trace(const WeakMember<T>& t) | 245 void trace(const WeakMember<T>& t) |
246 { | 246 { |
247 registerWeakCell(t.cell()); | 247 registerWeakCell(t.cell()); |
248 } | 248 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 return visitor->isMarked(obj); | 397 return visitor->isMarked(obj); |
398 } | 398 } |
399 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor
, const Member<T>& obj) | 399 template<typename T> bool ObjectAliveTrait<Member<T> >::isAlive(Visitor* visitor
, const Member<T>& obj) |
400 { | 400 { |
401 return visitor->isMarked(obj.raw()); | 401 return visitor->isMarked(obj.raw()); |
402 } | 402 } |
403 | 403 |
404 } | 404 } |
405 | 405 |
406 #endif | 406 #endif |
OLD | NEW |