8000 gh-128182: Add per-object memory access synchronization to `ctypes` by ZeroIntensity · Pull Request #128490 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128182: Add per-object memory access synchronization to ctypes #128490

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

Merged
merged 24 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Clarify comment
  • Loading branch information
ZeroIntensity committed Jan 6, 2025
commit 6401bbcecfc204ff2984a41e59122b5abb8efbca
4 changes: 3 additions & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@
return -1;
}
LOCK_PTR(self);
int rc = PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size);

Check warning on line 1555 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (arm64)

'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 1555 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (arm64)

'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 1555 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'initializing': convers 9712 ion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 1555 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]
UNLOCK_PTR(self);
return rc < 0 ? -1 : 0;
}
Expand Down Expand Up @@ -3112,7 +3112,9 @@
static int
PyCData_MallocBuffer(CDataObject *obj, StgInfo *info)
{
// We don't have to lock in this function
/* We don't have to lock in this function, because it's only
used in constructors and therefore does not have concurrent
access. */
if ((size_t)info->size <= sizeof(obj->b_value)) {
/* No need to call malloc, can use the default buffer */
obj->b_ptr = (char *)&obj->b_value;
Expand Down
Loading
0