Skip to content

Commit dd9e404

Browse files
authored
Fix comment on PyBuffer::buf_ptr (#5327)
1 parent 700b4cc commit dd9e404

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/buffer.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,13 @@ impl<T: Element> PyBuffer<T> {
229229

230230
/// Gets the pointer to the start of the buffer memory.
231231
///
232-
/// Warning: the buffer memory might be mutated by other Python functions,
233-
/// and thus may only be accessed while the GIL is held.
232+
/// Warning: the buffer memory can be mutated by other code (including
233+
/// other Python functions, if the GIL is released, or other extension
234+
/// modules even if the GIL is held). You must either access memory
235+
/// atomically, or ensure there are no data races yourself. See
236+
/// [this blog post] for more details.
237+
///
238+
/// [this blog post]: https://alexgaynor.net/2022/oct/23/buffers-on-the-edge/
234239
#[inline]
235240
pub fn buf_ptr(&self) -> *mut c_void {
236241
self.0.buf

0 commit comments

Comments
 (0)