We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c68f41b commit 5efa5d8Copy full SHA for 5efa5d8
src/x11.rs
@@ -540,6 +540,8 @@ struct ShmSegment {
540
impl ShmSegment {
541
/// Create a new `ShmSegment` with the given size.
542
fn new(size: usize, buffer_size: usize) -> io::Result<Self> {
543
+ assert!(size >= buffer_size);
544
+
545
unsafe {
546
// Create the shared memory segment.
547
let id = shmget(IPC_PRIVATE, size, 0o600);
@@ -588,6 +590,7 @@ impl ShmSegment {
588
590
589
591
/// Set the size of the buffer for this shared memory segment.
592
fn set_buffer_size(&mut self, buffer_size: usize) {
593
+ assert!(self.size >= buffer_size);
594
self.buffer_size = buffer_size
595
}
596
0 commit comments