2023-03-01 21:23:33 +08:00

13 lines
288 B
C

#include "weakref.h"
Arg* weakref_ref(PikaObj* self, Arg* aObj) {
if (arg_isObject(aObj)) {
PikaObj* obj = arg_getPtr(aObj);
Arg* ret = arg_copy(aObj);
obj_refcntDec(obj);
arg_setIsWeakRef(ret, PIKA_TRUE);
return ret;
}
return NULL;
}