Skip to content

Commit 2702435

Browse files
committed
use FT_ATOMIC macro to store ptr
1 parent 3645754 commit 2702435

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/_heapqmodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
5959
arr = _PyList_ITEMS(heap);
6060
parent = arr[parentpos];
6161
newitem = arr[pos];
62-
_Py_atomic_store_ptr(&arr[parentpos], newitem);
63-
_Py_atomic_store_ptr(&arr[pos], parent);
62+
FT_ATOMIC_STORE_PTR_RELEASE(arr[parentpos], newitem);
63+
FT_ATOMIC_STORE_PTR_RELEASE(arr[pos], parent);
6464
pos = parentpos;
6565
}
6666
return 0;
@@ -108,8 +108,8 @@ siftup(PyListObject *heap, Py_ssize_t pos)
108108
/* Move the smaller child up. */
109109
tmp1 = arr[childpos];
110110
tmp2 = arr[pos];
111-
_Py_atomic_store_ptr(&arr[childpos], tmp2);
112-
_Py_atomic_store_ptr(&arr[pos], tmp1);
111+
FT_ATOMIC_STORE_PTR_RELEASE(arr[childpos], tmp2);
112+
FT_ATOMIC_STORE_PTR_RELEASE(arr[pos], tmp1);
113113
pos = childpos;
114114
}
115115
/* Bubble it up to its final resting place (by sifting its parents down). */
@@ -174,7 +174,7 @@ heappop_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
174174
returnitem = PyList_GET_ITEM(heap, 0);
175175
// We're in the critical section now
176176
PyListObject *list = _PyList_CAST(heap);
177-
_Py_atomic_store_ptr(&list->ob_item[0], lastelt);
177+
FT_ATOMIC_STORE_PTR_RELEASE(list->ob_item[0], lastelt);
178178
if (siftup_func(list, 0)) {
179179
Py_DECREF(returnitem);
180180
return NULL;

0 commit comments

Comments
 (0)