Home | History | Annotate | Download | only in utils

Lines Matching full:refs

171     void addRef(ref_entry** refs, const void* id, int32_t mRef)
185 ref->next = *refs;
186 *refs = ref;
190 void removeRef(ref_entry** refs, const void* id)
195 ref_entry* ref = *refs;
198 *refs = ref->next;
203 refs = &ref->next;
204 ref = *refs;
212 void printRefsLocked(String8* out, const ref_entry* refs) const
215 while (refs) {
216 char inc = refs->ref >= 0 ? '+' : '-';
218 inc, refs->id, refs->ref);
221 out->append(refs->stack.toString("\t\t"));
225 refs = refs->next;
239 void addRef(KeyedVector<const void*, int32_t>* refs, const void* id)
242 ssize_t i = refs->indexOfKey(id);
244 ++(refs->editValueAt(i));
246 i = refs->add(id, 1);
250 void removeRef(KeyedVector<const void*, int32_t>* refs, const void* id)
253 ssize_t i = refs->indexOfKey(id);
256 int32_t val = --(refs->editValueAt(i));
258 refs->removeItemsAt(i);
263 void printRefs(const KeyedVector<const void*, int32_t>& refs)
265 const size_t N=refs.size();
267 printf("\tID %p: %d remain\n", refs.keyAt(i), refs.valueAt(i));
283 weakref_impl* const refs = mRefs;
284 refs->addWeakRef(id);
285 refs->incWeak(id);
287 refs->addStrongRef(id);
288 const int32_t c = android_atomic_inc(&refs->mStrong);
289 LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
297 android_atomic_add(-INITIAL_STRONG_VALUE, &refs->mStrong);
303 weakref_impl* const refs = mRefs;
304 refs->removeStrongRef(id);
305 const int32_t c = android_atomic_dec(&refs->mStrong);
309 LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
312 if ((refs->mFlags&OBJECT_LIFETIME_WEAK) != OBJECT_LIFETIME_WEAK) {
316 refs->removeWeakRef(id);
317 refs->decWeak(id);
322 weakref_impl* const refs = mRefs;
323 refs->addWeakRef(id);
324 refs->incWeak(id);
326 refs->addStrongRef(id);
327 const int32_t c = android_atomic_inc(&refs->mStrong);
329 refs);
336 android_atomic_add(-INITIAL_STRONG_VALUE, &refs->mStrong);
375 // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase);
500 // LOGV("Creating refs %p with RefBase %p\n", mRefs, this);
505 // LOGV("Destroying RefBase %p (refs %p)\n", this, mRefs);
507 // LOGV("Freeing refs %p of old RefBase %p\n", mRefs, this);