MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_SaveUnsigned

Function RM_SaveUnsigned

src/module.cpp:4754–4768  ·  view source on GitHub ↗

Save an unsigned 64 bit value into the RDB file. This function should only * be called in the context of the rdb_save method of modules implementing new * data types. */

Source from the content-addressed store, hash-verified

4752 * be called in the context of the rdb_save method of modules implementing new
4753 * data types. */
4754void RM_SaveUnsigned(RedisModuleIO *io, uint64_t value) {
4755 if (io->error) return;
4756 /* Save opcode. */
4757 int retval = rdbSaveLen(io->prio, RDB_MODULE_OPCODE_UINT);
4758 if (retval == -1) goto saveerr;
4759 io->bytes += retval;
4760 /* Save value. */
4761 retval = rdbSaveLen(io->prio, value);
4762 if (retval == -1) goto saveerr;
4763 io->bytes += retval;
4764 return;
4765
4766saveerr:
4767 io->error = 1;
4768}
4769
4770/* Load an unsigned 64 bit value from the RDB file. This function should only
4771 * be called in the context of the `rdb_load` method of modules implementing

Callers 1

RM_SaveSignedFunction · 0.85

Calls 1

rdbSaveLenFunction · 0.85

Tested by

no test coverage detected