Commit 75e62f7c authored by Joe Lee's avatar Joe Lee

kj::atomicAddRef(): Fix assertion error message

parent 355697c8
......@@ -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