13 lines
288 B
C
Raw Normal View History

#include "weakref.h"
2023-02-23 21:43:40 +08:00
Arg* weakref_ref(PikaObj* self, Arg* aObj) {
2023-03-01 21:23:33 +08:00
if (arg_isObject(aObj)) {
2023-02-23 21:43:40 +08:00
PikaObj* obj = arg_getPtr(aObj);
Arg* ret = arg_copy(aObj);
obj_refcntDec(obj);
arg_setIsWeakRef(ret, PIKA_TRUE);
return ret;
}
return NULL;
}