Unverified Commit 523d4f94 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #884 from capnproto/jlee/fix-atomic-refcounted-message

kj::atomicAddRef(): Fix assertion error message
parents 355697c8 75e62f7c
......@@ -173,13 +173,15 @@ inline kj::Own<T> atomicRefcounted(Params&&... params) {
template <typename T>
kj::Own<T> atomicAddRef(T& object) {
KJ_IREQUIRE(object.AtomicRefcounted::refcount > 0, "Object not allocated with kj::refcounted().");
KJ_IREQUIRE(object.AtomicRefcounted::refcount > 0,
"Object not allocated with kj::atomicRefcounted().");
return AtomicRefcounted::addRefInternal(&object);
}
template <typename T>
kj::Own<const T> atomicAddRef(const T& object) {
KJ_IREQUIRE(object.AtomicRefcounted::refcount > 0, "Object not allocated with kj::refcounted().");
KJ_IREQUIRE(object.AtomicRefcounted::refcount > 0,
"Object not allocated with kj::atomicRefcounted().");
return AtomicRefcounted::addRefInternal(&object);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment