|
From: <sv...@va...> - 2006-08-28 12:32:46
|
Author: sewardj
Date: 2006-08-28 13:32:43 +0100 (Mon, 28 Aug 2006)
New Revision: 6026
Log:
Merge r6001 (fix for: Alex Bennee mmap problem (9 Aug))=20
Modified:
branches/VALGRIND_3_2_BRANCH/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/VALGRIND_3_2_BRANCH/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/coregrind/m_aspacemgr/aspacemgr.c 2006-0=
8-28 12:28:51 UTC (rev 6025)
+++ branches/VALGRIND_3_2_BRANCH/coregrind/m_aspacemgr/aspacemgr.c 2006-0=
8-28 12:32:43 UTC (rev 6026)
@@ -994,6 +994,12 @@
case SkShmC:
return False;
=20
+ case SkResvn:
+ if (s1->smode =3D=3D SmFixed && s2->smode =3D=3D SmFixed) {
+ s1->end =3D s2->end;
+ return True;
+ }
+
default:
break;
=20
@@ -2232,9 +2238,22 @@
needDiscard =3D any_Ts_in_range( start, len );
=20
init_nsegment( &seg );
- seg.kind =3D SkFree;
seg.start =3D start;
seg.end =3D start + len - 1;
+
+ /* The segment becomes unused (free). Segments from above
+ aspacem_maxAddr were originally SkResvn and so we make them so
+ again. Note, this isn't really right when the segment straddles
+ the aspacem_maxAddr boundary - then really it should be split in
+ two, the lower part marked as SkFree and the upper part as
+ SkResvn. Ah well. */
+ if (start > aspacem_maxAddr=20
+ && /* check previous comparison is meaningful */
+ aspacem_maxAddr < Addr_MAX)
+ seg.kind =3D SkResvn;
+ else
+ seg.kind =3D SkFree;
+
add_segment( &seg );
=20
/* Unmapping could create two adjacent free segments, so a preen is
@@ -2995,9 +3014,17 @@
=20
/* Create a free hole in the old location. */
init_nsegment( &seg );
- seg.kind =3D SkFree;
seg.start =3D old_addr;
seg.end =3D old_addr + old_len - 1;
+ /* See comments in VG_(am_notify_munmap) about this SkResvn vs
+ SkFree thing. */
+ if (old_addr > aspacem_maxAddr=20
+ && /* check previous comparison is meaningful */
+ aspacem_maxAddr < Addr_MAX)
+ seg.kind =3D SkResvn;
+ else
+ seg.kind =3D SkFree;
+
add_segment( &seg );
=20
AM_SANITY_CHECK;
|