https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=edac7e5345c53bc85331f94041992e7b7f042960
commit edac7e5345c53bc85331f94041992e7b7f042960 Author: Ken Brown <[email protected]> Date: Fri Dec 20 12:17:34 2024 -0500 Cygwin: mmap: remove is_mmapped_region() The last use was removed in commit 29a126322783 ("Simplify stack allocation code in child after fork"). Signed-off-by: Ken Brown <[email protected]> Diff: --- winsup/cygwin/local_includes/winsup.h | 1 - winsup/cygwin/mm/mmap.cc | 33 --------------------------------- 2 files changed, 34 deletions(-) diff --git a/winsup/cygwin/local_includes/winsup.h b/winsup/cygwin/local_includes/winsup.h index 38313962d..6841d4a59 100644 --- a/winsup/cygwin/local_includes/winsup.h +++ b/winsup/cygwin/local_includes/winsup.h @@ -239,7 +239,6 @@ enum mmap_region_status MMAP_NORESERVE_COMMITED }; mmap_region_status mmap_is_attached_or_noreserve (void *addr, size_t len); -bool is_mmapped_region (caddr_t start_addr, caddr_t end_address); extern inline bool flush_file_buffers (HANDLE h) { diff --git a/winsup/cygwin/mm/mmap.cc b/winsup/cygwin/mm/mmap.cc index 37b11b4cd..cb8548a85 100644 --- a/winsup/cygwin/mm/mmap.cc +++ b/winsup/cygwin/mm/mmap.cc @@ -730,39 +730,6 @@ mmap_areas::del_list (mmap_list *ml) cfree (ml); } -/* This function allows an external function to test if a given memory - region is part of an mmapped memory region. */ -bool -is_mmapped_region (caddr_t start_addr, caddr_t end_address) -{ - size_t len = end_address - start_addr; - - LIST_READ_LOCK (); - mmap_list *map_list = mmapped_areas.get_list_by_fd (-1, NULL); - - if (!map_list) - { - LIST_READ_UNLOCK (); - return false; - } - - mmap_record *rec; - caddr_t u_addr; - SIZE_T u_len; - bool ret = false; - - LIST_FOREACH (rec, &map_list->recs, mr_next) - { - if (rec->match (start_addr, len, u_addr, u_len)) - { - ret = true; - break; - } - } - LIST_READ_UNLOCK (); - return ret; -} - /* This function is called from exception_handler when a segmentation violation has occurred. It should also be called from all Cygwin functions that want to support passing noreserve (anonymous) mmap
