Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support machines with multiple NICs #576
Support machines with multiple NICs #576
Changes from 21 commits
14efed9
e21ae79
6b0f9a6
c32b167
09bce25
ba7de63
dd1ef85
88ce700
4c923f2
7d85fc1
ced3fd0
bf48f38
36af146
89c61e0
48fc70e
d72a5ea
fc5ffb8
0ae4e04
503b938
1d22f3d
93fd4df
461d5e0
7cf9110
a0825e0
f7e1537
cab8e12
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬 now that I'm thinking about it, this isn't 1000% safe either
if (in theory) the sequence wasn't a tuple or list but something with a custom
__getitem__()
that returned a new object, then when we decref it here, it would get cleaned up, and ourchar *
would be pointing at discarded memoryI looked at how PySequence_Fast_GET_ITEM() could get away with a borrowed reference, and it does it by ensuring a list or tuple was passed it, and if it was something else, it creates a list instead so it can be sure the items live at least as long as whatever's returned (see code)
anyway blugh ugh ugh ugh ugh I realize this bug exists elsewhere in our C-bindings
maybe keep these items alive until
cleanup
, similar to the array of cursors. Like:aws_mem_calloc()
them at the same timenetwork_interface_name_pyobjects[i] = PySequence_GetItem(network_interface_names_py, i); /* New reference */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not TRYING to make your life miserable. I'm just like "oh hey PySequence exists, let's use it" ... "uh oh"
Another option is doing like PySequence_Fast .. and turning it into a
list
(if necessary) before processing it. In python we could just be like:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have updated it to the second option.