MCPcopy Create free account
hub / github.com/aguinet/dragonffi / getMemoryViewObjects

Method getMemoryViewObjects

bindings/python/cobj.cpp:586–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586py::memoryview CPointerObj::getMemoryViewObjects(size_t Len)
587{
588 auto PointeeTy = getPointeeType();
589 const size_t PointeeSize = PointeeTy->getSize();
590 // TODO: check integer overflow
591 // TODO: ssize_t is an issue
592 py::buffer_info BI(py::buffer_info{getPtr(), static_cast<ssize_t>(PointeeSize), getFormatDescriptor(PointeeTy), static_cast<ssize_t>(Len)});
593 BI.readonly = PointeeTy.hasConst();
594 return memoryview_from_buffer_info(BI);
595}
596
597py::memoryview CPointerObj::getMemoryViewCStr()
598{

Callers

nothing calls this directly

Calls 3

getFormatDescriptorFunction · 0.85
getSizeMethod · 0.45

Tested by

no test coverage detected