MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / Strs_get_offsets_address

Function Strs_get_offsets_address

python/stringzilla.c:1908–1921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1906}
1907
1908static PyObject *Strs_get_offsets_address(Strs *self, void *closure) {
1909 if (!Strs_ensure_tape_layout(self)) return NULL;
1910
1911 void *offsets_ptr = NULL;
1912 switch (self->layout) {
1913 case STRS_U32_TAPE_VIEW: offsets_ptr = self->data.u32_tape_view.offsets; break;
1914 case STRS_U32_TAPE: offsets_ptr = self->data.u32_tape.offsets; break;
1915 case STRS_U64_TAPE_VIEW: offsets_ptr = self->data.u64_tape_view.offsets; break;
1916 case STRS_U64_TAPE: offsets_ptr = self->data.u64_tape.offsets; break;
1917 default: PyErr_SetString(PyExc_RuntimeError, "Unknown Strs layout"); return NULL;
1918 }
1919
1920 return PyLong_FromSize_t((sz_size_t)offsets_ptr);
1921}
1922
1923static PyObject *Strs_get_tape_nbytes(Strs *self, void *closure) {
1924 if (!Strs_ensure_tape_layout(self)) return NULL;

Callers

nothing calls this directly

Calls 1

Strs_ensure_tape_layoutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…