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

Function rdbSaveBinaryDoubleValue

src/rdb.cpp:649–652  ·  view source on GitHub ↗

Saves a double for RDB 8 or greater, where IE754 binary64 format is assumed. * We just make sure the integer is always stored in little endian, otherwise * the value is copied verbatim from memory to disk. * * Return -1 on error, the size of the serialized value on success. */

Source from the content-addressed store, hash-verified

647 *
648 * Return -1 on error, the size of the serialized value on success. */
649int rdbSaveBinaryDoubleValue(rio *rdb, double val) {
650 memrev64ifbe(&val);
651 return rdbWriteRaw(rdb,&val,sizeof(val));
652}
653
654/* Loads a double from RDB 8 or greater. See rdbSaveBinaryDoubleValue() for
655 * more info. On error -1 is returned, otherwise 0. */

Callers 2

rdbSaveObjectFunction · 0.85
RM_SaveDoubleFunction · 0.85

Calls 1

rdbWriteRawFunction · 0.85

Tested by

no test coverage detected