MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / int_storage_bytes

Function int_storage_bytes

internal/cbm/sqlite_writer.c:253–274  ·  view source on GitHub ↗

Bytes needed to store an integer of given serial type

Source from the content-addressed store, hash-verified

251
252// Bytes needed to store an integer of given serial type
253static int int_storage_bytes(int serial_type) {
254 switch (serial_type) {
255 case 0:
256 return 0; // NULL
257 case SERIAL_INT8:
258 return SERIAL_SIZE_INT8;
259 case SERIAL_INT16:
260 return SERIAL_SIZE_INT16;
261 case SERIAL_INT24:
262 return SERIAL_SIZE_INT24;
263 case SERIAL_INT32:
264 return SERIAL_SIZE_INT32;
265 case SERIAL_INT48:
266 return SERIAL_SIZE_INT48;
267 case SERIAL_INT64:
268 return SERIAL_SIZE_INT64;
269 case SERIAL_CONST_ZERO: // integer 0
270 case SERIAL_CONST_ONE: // integer 1
271 default:
272 return 0;
273 }
274}
275
276// Write integer in big-endian for given byte count
277static void put_int_be(uint8_t *buf, int64_t val, int nbytes) {

Callers 1

rec_add_intFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected