MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_LoadUnsigned

Function RM_LoadUnsigned

app/redis-6.2.6/src/module.c:4668–4682  ·  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

4666 * be called in the context of the `rdb_load` method of modules implementing
4667 * new data types. */
4668uint64_t RM_LoadUnsigned(RedisModuleIO *io) {
4669 if (io->error) return 0;
4670 if (io->ver == 2) {
4671 uint64_t opcode = rdbLoadLen(io->rio,NULL);
4672 if (opcode != RDB_MODULE_OPCODE_UINT) goto loaderr;
4673 }
4674 uint64_t value;
4675 int retval = rdbLoadLenByRef(io->rio, NULL, &value);
4676 if (retval == -1) goto loaderr;
4677 return value;
4678
4679loaderr:
4680 moduleRDBLoadError(io);
4681 return 0;
4682}
4683
4684/* Like RedisModule_SaveUnsigned() but for signed 64 bit values. */
4685void 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