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

Function RM_SaveFloat

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

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

Source from the content-addressed store, hash-verified

4817 * value to the RDB file. The float can be a valid number, a NaN or infinity.
4818 * It is possible to load back the value with RedisModule_LoadFloat(). */
4819void RM_SaveFloat(RedisModuleIO *io, float value) {
4820 if (io->error) return;
4821 /* Save opcode. */
4822 int retval = rdbSaveLen(io->rio, RDB_MODULE_OPCODE_FLOAT);
4823 if (retval == -1) goto saveerr;
4824 io->bytes += retval;
4825 /* Save value. */
4826 retval = rdbSaveBinaryFloatValue(io->rio, value);
4827 if (retval == -1) goto saveerr;
4828 io->bytes += retval;
4829 return;
4830
4831saveerr:
4832 io->error = 1;
4833}
4834
4835/* In the context of the rdb_save method of a module data type, loads back the
4836 * float value saved by RedisModule_SaveFloat(). */

Callers

nothing calls this directly

Calls 2

rdbSaveLenFunction · 0.85
rdbSaveBinaryFloatValueFunction · 0.85

Tested by

no test coverage detected