Skip to contentSkip to conversation

kref, a tiny, sane, reference count object

RFC Andi Kleen 1 participant 1 message Mar 13, 2004 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#3 lore raw
Quoted 1 line · Greg KH

But people do get it wrong (I've seen it happen). Using this keeps you

If they cannot get a simple reference counter right it is doubtful the rest of their code will do any good.

Quoted 3 lines

from having to write your own get, and put functions. Multiply that by every usb driver that wants to (and needs to) use this kind of logic, and you have a lot of duplicated code that is unnecessary.

Lots of duplicated one liners. Sounds like a big issue. For me this thing smells more like overabstraction.

Quoted 2 lines

So we write it once, get it correct, and let everyone use it. Isn't that what the code in /lib is for? :)

I would agree if it is significant code. But all you're replacing is a few straight forward one/two liners, and that at the cost of less efficient space usage (12 byte overhead on 64bit)

-Andi