From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C6AD73858C53; Fri, 5 Aug 2022 10:01:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6AD73858C53 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: mount_info::get_mounts_here: alloc temp mountpoint info on cygheap X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: d097a96e6e5319ab622d5d737c70b21e4a231bec X-Git-Newrev: 1e428bee1c5ef7c76ba4e46e6693b913edc9bbf3 Message-Id: <20220805100153.C6AD73858C53@sourceware.org> Date: Fri, 5 Aug 2022 10:01:53 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2022 10:01:53 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1e428bee1c5= ef7c76ba4e46e6693b913edc9bbf3 commit 1e428bee1c5ef7c76ba4e46e6693b913edc9bbf3 Author: Corinna Vinschen Date: Fri Aug 5 12:01:45 2022 +0200 Cygwin: mount_info::get_mounts_here: alloc temp mountpoint info on cygh= eap =20 That *should* be slightly faster than allocating on the user heap. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/mount.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 76d1e9a6d..63c9d2874 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -739,15 +739,15 @@ mount_info::get_mounts_here (const char *parent_dir, = size_t parent_dir_len, if (last_slash =3D=3D mi->posix_path) { if (parent_dir_len =3D=3D 1 && mi->posix_pathlen > 1) - sys_mbstouni_alloc (&mount_points[n_mounts++], HEAP_NOTHEAP, + sys_mbstouni_alloc (&mount_points[n_mounts++], HEAP_BUF, last_slash + 1); } else if (parent_dir_len =3D=3D (size_t) (last_slash - mi->posix_path) && strncasematch (parent_dir, mi->posix_path, parent_dir_len)) - sys_mbstouni_alloc (&mount_points[n_mounts++], HEAP_NOTHEAP, + sys_mbstouni_alloc (&mount_points[n_mounts++], HEAP_BUF, last_slash + 1); } - sys_mbstouni_alloc (cygd, HEAP_NOTHEAP, cygdrive + 1); + sys_mbstouni_alloc (cygd, HEAP_BUF, cygdrive + 1); if (cygd->Length) cygd->Length -=3D 2; // Strip trailing slash return n_mounts; @@ -758,8 +758,8 @@ mount_info::free_mounts_here (PUNICODE_STRING mount_poi= nts, int n_mounts, PUNICODE_STRING cygd) { for (int i =3D 0; i < n_mounts; ++i) - free (mount_points[i].Buffer); - free (cygd->Buffer); + cfree (mount_points[i].Buffer); + cfree (cygd->Buffer); } =20 /* cygdrive_posix_path: Build POSIX path used as the