-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak in
Raw.copy()
(#709)
* Fix memory leak in Raw.copy(). Raw_New borrows a reference to its PyBytesObject argument, so Raw_Copy must still dispose of it. The following is a minimal repro for this issue: import msgspec DECODER = msgspec.msgpack.Decoder(type=msgspec.Raw) PAYLOAD = b"\xda\xff\xff" + (65535 * b"\0") # array of 65535 zeros for _ in range(1000000): raw = DECODER.decode(PAYLOAD) raw.copy() * Add test for raw copy memleak --------- Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters