lkml.org 
[lkml]   [2017]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 02/11] refcount: Implement inc/decrement-and-return functions
Date
Peter Zijlstra <peterz@infradead.org> wrote:

> if (obj) {
> /* use obj */
> refcount_dec(&obj->refs); /* should never hit 0 */
> }

You've missed a bit: We need to tell the gc to run when we reduce the refcount
to 1:

if (obj) {
...
if (refcount_dec_return(&obj->refs) == 1)
schedule_gc();
}

David

\
 
 \ /
  Last update: 2017-09-02 00:52    [W:0.126 / U:1.128 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site