MCPcopy Index your code
hub / github.com/apache/fory / py_long_to_int64

Function py_long_to_int64

python/pyfory/cpp/pyfory.cc:560–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560static bool py_long_to_int64(PyObject *value, int64_t *out) {
561 int overflow = 0;
562 long long converted = PyLong_AsLongLongAndOverflow(value, &overflow);
563 if (converted == -1 && PyErr_Occurred()) {
564 return false;
565 }
566 if (overflow != 0) {
567 PyErr_SetString(PyExc_OverflowError,
568 "integer out of range for int64 fastpath");
569 return false;
570 }
571 *out = static_cast<int64_t>(converted);
572 return true;
573}
574
575static bool can_use_list_sequence_fastpath(PyObject **items, Py_ssize_t size,
576 uint8_t type_id) {

Callers 3

write_primitive_itemFunction · 0.85
write_primitive_sequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected