Skip to content

Commit

Permalink
Better bytearray allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
bengineerd committed Oct 15, 2024
1 parent 3832713 commit 986489a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rogue/interfaces/stream/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ bp::object ris::Frame::readBytearrayPy(uint32_t offset) {
uint32_t size = getPayload();

// Create a Python bytearray to hold the data
boost::python::object byteArray = boost::python::eval("bytearray")(size - offset);
bp::object byteArray(bp::handle<>(PyByteArray_FromStringAndSize(nullptr, size - offset)));


this->readPy(byteArray, offset);

Expand Down

0 comments on commit 986489a

Please sign in to comment.