-
Notifications
You must be signed in to change notification settings - Fork 784
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
More bytes, dict FFI #820
Merged
Merged
More bytes, dict FFI #820
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use crate::ffi::object::*; | ||
use crate::ffi::pyport::Py_ssize_t; | ||
use crate::ffi::pyport::{Py_hash_t, Py_ssize_t}; | ||
use std::os::raw::{c_char, c_int}; | ||
|
||
#[cfg_attr(windows, link(name = "pythonXY"))] | ||
|
@@ -79,7 +79,7 @@ extern "C" { | |
mp: *mut PyObject, | ||
key: *mut PyObject, | ||
item: *mut PyObject, | ||
hash: crate::ffi::pyport::Py_hash_t, | ||
hash: Py_hash_t, | ||
) -> c_int; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_DelItem")] | ||
pub fn PyDict_DelItem(mp: *mut PyObject, key: *mut PyObject) -> c_int; | ||
|
@@ -92,6 +92,14 @@ extern "C" { | |
key: *mut *mut PyObject, | ||
value: *mut *mut PyObject, | ||
) -> c_int; | ||
#[cfg(not(PyPy))] | ||
pub fn _PyDict_Next( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/python/cpython/blob/a24107b04c1277e3c1105f98aff5bfa3a98b33a0/Include/cpython/dictobject.h#L49 and elsewhere for the others. |
||
mp: *mut PyObject, | ||
pos: *mut Py_ssize_t, | ||
key: *mut *mut PyObject, | ||
value: *mut *mut PyObject, | ||
hash: *mut Py_hash_t, | ||
) -> c_int; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_Keys")] | ||
pub fn PyDict_Keys(mp: *mut PyObject) -> *mut PyObject; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_Values")] | ||
|
@@ -104,6 +112,8 @@ extern "C" { | |
pub fn PyDict_Copy(mp: *mut PyObject) -> *mut PyObject; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_Contains")] | ||
pub fn PyDict_Contains(mp: *mut PyObject, key: *mut PyObject) -> c_int; | ||
#[cfg(not(PyPy))] | ||
pub fn _PyDict_Contains(mp: *mut PyObject, key: *mut PyObject, hash: Py_ssize_t) -> c_int; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_Update")] | ||
pub fn PyDict_Update(mp: *mut PyObject, other: *mut PyObject) -> c_int; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_Merge")] | ||
|
@@ -119,4 +129,6 @@ extern "C" { | |
) -> c_int; | ||
#[cfg_attr(PyPy, link_name = "PyPyDict_DelItemString")] | ||
pub fn PyDict_DelItemString(dp: *mut PyObject, key: *const c_char) -> c_int; | ||
#[cfg(not(PyPy))] | ||
pub fn _PyObject_GetDictPtr(obj: *mut PyObject) -> *mut *mut PyObject; | ||
} |
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.
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.
https://docs.python.org/3/c-api/bytes.html#c._PyBytes_Resize