Set a special refcount in the object to make it "shared": * incrRefCount and decrRefCount() will test for this special refcount * and will not touch the object. This way it is free to access shared * objects such as small integers from different threads without any * mutex. * * A common patter to create shared objects: * * robj *myobject = makeObjectShared(createObject(...)); * */
| 67 | * |
| 68 | */ |
| 69 | robj *makeObjectShared(robj *o) { |
| 70 | serverAssert(o->refcount == 1); |
| 71 | o->refcount = OBJ_SHARED_REFCOUNT; |
| 72 | return o; |
| 73 | } |
| 74 | |
| 75 | /* Create a string object with encoding OBJ_ENCODING_RAW, that is a plain |
| 76 | * string object where o->ptr points to a proper sds string. */ |
no outgoing calls
no test coverage detected