(self, o)
| 546 | return s.contents.m_length |
| 547 | |
| 548 | def lean_string_cstr(self, o): |
| 549 | str_cls = structs.get("lean_string_object") |
| 550 | s = ctypes.cast(o, POINTER(str_cls)) |
| 551 | offset = str_cls.m_data.offset |
| 552 | addr = ctypes.addressof(s.contents) + offset |
| 553 | return ctypes.cast(addr, c_char_p) |
| 554 | |
| 555 | # ----- Allocation primitives (delegated to leanpy_native helpers) ----- |
| 556 | def lean_alloc_ctor(self, tag, num_objs, scalar_sz): |
no test coverage detected