MCPcopy Create free account
hub / github.com/pybind/pybind11 / enable_buffer_protocol

Function enable_buffer_protocol

include/pybind11/detail/class.h:733–738  ·  view source on GitHub ↗

Give this type a buffer interface.

Source from the content-addressed store, hash-verified

731
732/// Give this type a buffer interface.
733inline void enable_buffer_protocol(PyHeapTypeObject *heap_type) {
734 heap_type->ht_type.tp_as_buffer = &heap_type->as_buffer;
735
736 heap_type->as_buffer.bf_getbuffer = pybind11_getbuffer;
737 heap_type->as_buffer.bf_releasebuffer = pybind11_releasebuffer;
738}
739
740/** Create a brand new Python type according to the `type_record` specification.
741 Return value: New reference. */

Callers 1

make_new_python_typeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected