Lines Matching full:safety

49 // SAFETY: The shrinker and list_lru are thread safe.
51 // SAFETY: The shrinker and list_lru are thread safe.
57 /// # Safety
70 // SAFETY: These fields are not yet used, so it's okay to zero them. in register()
76 // SAFETY: The field is not yet used, so we can initialize it. in register()
82 // SAFETY: The `name` points at a valid c string. in register()
85 // SAFETY: We initialized it, so its okay to destroy it. in register()
90 // SAFETY: We're about to register the shrinker, and these are the fields we need to in register()
98 // SAFETY: The new shrinker has been fully initialized, so we can register it. in register()
101 // SAFETY: This initializes the pointer to the shrinker so that we can use it. in register()
153 // SAFETY: Just reading the vm_ops pointer of any active vma is safe. in check_vma()
159 // SAFETY: Reading the vm_private_data pointer of a binder-owned vma is safe. in check_vma()
183 // SAFETY: proper locking is in place for `Inner`
206 /// # Safety
210 // SAFETY: This pointer offset is in bounds. in set_page()
213 // SAFETY: The pointer is valid for writing, so also valid for reading. in set_page()
216 // SAFETY: We will initialize the page again below. in set_page()
220 // SAFETY: The pointer is valid for writing. in set_page()
224 /// # Safety
228 // SAFETY: This pointer offset is in bounds. in get_page()
231 // SAFETY: The pointer is valid for reading. in get_page()
235 /// # Safety
239 // SAFETY: This pointer offset is in bounds. in take_page()
242 // SAFETY: The pointer is valid for reading. in take_page()
248 /// # Safety
252 // SAFETY: This pointer offset is in bounds. in list_lru_add()
254 // SAFETY: The lru pointer is valid, and we're not using it with any other lru list. in list_lru_add()
260 /// # Safety
264 // SAFETY: This pointer offset is in bounds. in list_lru_del()
266 // SAFETY: The lru pointer is valid, and we're not using it with any other lru list. in list_lru_del()
289 // SAFETY: This extends the duration of the reference. Since this call happens before in stable_trylock_mm()
313 // SAFETY: This just initializes the pages array. in register_with_vma()
339 // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on in register_with_vma()
345 // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on in register_with_vma()
363 // SAFETY: This pointer offset is in bounds. in use_range()
366 // SAFETY: The pointer is valid, and we hold the lock so reading from the page is okay. in use_range()
371 // SAFETY: The pointer is valid, and this is the right shrinker. in use_range()
379 // SAFETY: `i < end <= inner.size` so `i` is in bounds. in use_range()
397 /// # Safety
407 // SAFETY: This pointer offset is in bounds. in use_page_slow()
410 // SAFETY: The pointer is valid, and we hold the lock so reading from the page is okay. in use_page_slow()
415 // SAFETY: The pointer is valid, and this is the right shrinker. in use_page_slow()
462 // SAFETY: The `page_info` pointer is valid and currently does not have a page. The page in use_page_slow()
487 // SAFETY: The pointer is in bounds. in stop_using_range()
490 // SAFETY: Okay for reading since we have the lock. in stop_using_range()
492 // SAFETY: The pointer is valid, and it's the right shrinker. in stop_using_range()
500 /// # Safety
526 // SAFETY: The pointer is in bounds. in iterate()
528 // SAFETY: The caller guarantees that this page is in the "in use" state for the in iterate()
545 /// # Safety
554 // SAFETY: `self.iterate` has the same safety requirements as `copy_from_user_slice`. in copy_from_user_slice()
564 /// # Safety
570 // SAFETY: `self.iterate` has the same safety requirements as `read`. in read()
573 // SAFETY: The sum of `offset` and `to_copy` is bounded by the size of T. in read()
575 // SAFETY: The pointer points is in-bounds of the `out` variable, so it is valid. in read()
581 // SAFETY: We just initialised the data. in read()
587 /// # Safety
592 // SAFETY: `self.iterate` has the same safety requirements as `write`. in write()
595 // SAFETY: The sum of `offset` and `to_copy` is bounded by the size of T. in write()
597 // SAFETY: We have a reference to the object, so the pointer is valid. in write()
607 /// # Safety
611 // SAFETY: `self.iterate` has the same safety requirements as `copy_into`. in fill_zero()
632 // Note: This call is also necessary for the safety of `stable_trylock_mm`. in drop()
640 // SAFETY: Loop is in-bounds of the size. in drop()
642 // SAFETY: No other readers, so we can read. in drop()
644 // SAFETY: The pointer is valid and it's the right shrinker. in drop()
651 // SAFETY: `pages` was allocated as an `KVVec<PageInfo>` with capacity `size`. Furthermore, in drop()
658 /// # Safety
665 // SAFETY: We can access our own private data. in rust_shrink_count()
667 // SAFETY: Accessing the lru list is okay. Just an FFI call. in rust_shrink_count()
671 /// # Safety
678 // SAFETY: We can access our own private data. in rust_shrink_scan()
680 // SAFETY: Caller guarantees that it is safe to read this field. in rust_shrink_scan()
682 // SAFETY: Accessing the lru list is okay. Just an FFI call. in rust_shrink_scan()
696 /// # Safety
716 // SAFETY: The `range` field of `PageInfo` is immutable. in rust_shrink_free_page()
718 // SAFETY: The `range` outlives its `PageInfo` values. in rust_shrink_free_page()
742 // SAFETY: The item is in this lru list, so it's okay to remove it. in rust_shrink_free_page()
745 // SAFETY: Both pointers are in bounds of the same allocation. in rust_shrink_free_page()
748 // SAFETY: We hold the spinlock, so we can take the page. in rust_shrink_free_page()
761 // SAFETY: The lru lock is locked when this method is called. in rust_shrink_free_page()