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

Function RM_LoadUnsigned

src/module.cpp:4773–4788  ·  view source on GitHub ↗

Load an unsigned 64 bit value from the RDB file. This function should only * be called in the context of the `rdb_load` method of modules implementing * new data types. */

Source from the content-addressed store, hash-verified

4771 * be called in the context of the `rdb_load` method of modules implementing
4772 * new data types. */
4773uint64_t RM_LoadUnsigned(RedisModuleIO *io) {
4774 int retval;
4775 if (io->error) return 0;
4776 if (io->ver == 2) {
4777 uint64_t opcode = rdbLoadLen(io->prio,NULL);
4778 if (opcode != RDB_MODULE_OPCODE_UINT) goto loaderr;
4779 }
4780 uint64_t value;
4781 retval = rdbLoadLenByRef(io->prio, NULL, &value);
4782 if (retval == -1) goto loaderr;
4783 return value;
4784
4785loaderr:
4786 moduleRDBLoadError(io);
4787 return 0;
4788}
4789
4790/* Like RedisModule_SaveUnsigned() but for signed 64 bit values. */
4791void RM_SaveSigned(RedisModuleIO *io, int64_t value) {

Callers 1

RM_LoadSignedFunction · 0.85

Calls 3

rdbLoadLenFunction · 0.85
rdbLoadLenByRefFunction · 0.85
moduleRDBLoadErrorFunction · 0.85

Tested by

no test coverage detected