Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/pybuffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#############################################################################
# mirror of Py_buffer struct in Python Include/object.h

# Stable ABI since 3.11
struct Py_buffer
buf::Ptr{Cvoid}
obj::PyPtr
Expand All @@ -18,20 +19,15 @@ struct Py_buffer
shape::Ptr{Cssize_t}
strides::Ptr{Cssize_t}
suboffsets::Ptr{Cssize_t}

# some opaque padding fields to account for differences between
# Python versions (the structure changed in Python 2.7 and 3.3)
internal0::Ptr{Cvoid}
internal1::Ptr{Cvoid}
internal2::Ptr{Cvoid}
internal::Ptr{Cvoid}
end

mutable struct PyBuffer
buf::Py_buffer
PyBuffer() = begin
b = new(Py_buffer(C_NULL, PyPtr_NULL, 0, 0,
0, 0, C_NULL, C_NULL, C_NULL, C_NULL,
C_NULL, C_NULL, C_NULL))
C_NULL))
finalizer(pydecref, b)
return b
end
Expand Down
Loading