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

Function int_storage_bytes

internal/cbm/sqlite_writer.c:256–277  ·  view source on GitHub ↗

Bytes needed to store an integer of given serial type

Source from the content-addressed store, hash-verified

254
255// Bytes needed to store an integer of given serial type
256static int int_storage_bytes(int serial_type) {
257 switch (serial_type) {
258 case 0:
259 return 0; // NULL
260 case SERIAL_INT8:
261 return SERIAL_SIZE_INT8;
262 case SERIAL_INT16:
263 return SERIAL_SIZE_INT16;
264 case SERIAL_INT24:
265 return SERIAL_SIZE_INT24;
266 case SERIAL_INT32:
267 return SERIAL_SIZE_INT32;
268 case SERIAL_INT48:
269 return SERIAL_SIZE_INT48;
270 case SERIAL_INT64:
271 return SERIAL_SIZE_INT64;
272 case SERIAL_CONST_ZERO: // integer 0
273 case SERIAL_CONST_ONE: // integer 1
274 default:
275 return 0;
276 }
277}
278
279// Write integer in big-endian for given byte count
280static 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