Module-level methods for testing and diagnostics */
| 285 | |
| 286 | /* Module-level methods for testing and diagnostics */ |
| 287 | static PyObject * |
| 288 | py_check_data_alignment(PyObject *self, PyObject *args) |
| 289 | { |
| 290 | unsigned int capacity = DEFAULT_CAPACITY; |
| 291 | if (!PyArg_ParseTuple(args, "|I", &capacity)) { |
| 292 | return NULL; |
| 293 | } |
| 294 | BPlusNode *node = node_create(NODE_LEAF, capacity); |
| 295 | if (!node) { |
| 296 | return NULL; |
| 297 | } |
| 298 | uintptr_t addr = (uintptr_t)node->data; |
| 299 | node_destroy(node); |
| 300 | if (addr % CACHE_LINE_SIZE == 0) { |
| 301 | Py_RETURN_TRUE; |
| 302 | } |
| 303 | Py_RETURN_FALSE; |
| 304 | } |
| 305 | |
| 306 | static PyMethodDef module_methods[] = { |
| 307 | {"_check_data_alignment", py_check_data_alignment, METH_VARARGS, |
nothing calls this directly
no test coverage detected