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

Function RM_SaveDouble

app/redis-6.2.6/src/module.c:4782–4796  ·  view source on GitHub ↗

In the context of the rdb_save method of a module data type, saves a double * value to the RDB file. The double can be a valid number, a NaN or infinity. * It is possible to load back the value with RedisModule_LoadDouble(). */

Source from the content-addressed store, hash-verified

4780 * value to the RDB file. The double can be a valid number, a NaN or infinity.
4781 * It is possible to load back the value with RedisModule_LoadDouble(). */
4782void RM_SaveDouble(RedisModuleIO *io, double value) {
4783 if (io->error) return;
4784 /* Save opcode. */
4785 int retval = rdbSaveLen(io->rio, RDB_MODULE_OPCODE_DOUBLE);
4786 if (retval == -1) goto saveerr;
4787 io->bytes += retval;
4788 /* Save value. */
4789 retval = rdbSaveBinaryDoubleValue(io->rio, value);
4790 if (retval == -1) goto saveerr;
4791 io->bytes += retval;
4792 return;
4793
4794saveerr:
4795 io->error = 1;
4796}
4797
4798/* In the context of the rdb_save method of a module data type, loads back the
4799 * double value saved by RedisModule_SaveDouble(). */

Callers

nothing calls this directly

Calls 2

rdbSaveLenFunction · 0.85
rdbSaveBinaryDoubleValueFunction · 0.85

Tested by

no test coverage detected