|
From: <sv...@va...> - 2005-09-23 12:02:29
|
Author: sewardj
Date: 2005-09-23 13:02:22 +0100 (Fri, 23 Sep 2005)
New Revision: 4730
Log:
VG_(am_get_advisory): extend Policy Exception #1 to allow client hint
requests to be observed more often. This should allow loading of
prelinked libraries at their preferred address. Untested.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/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/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 11:40:2=
9 UTC (rev 4729)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 12:02:2=
2 UTC (rev 4730)
@@ -1525,9 +1525,13 @@
=20
If the request is for a fixed client map, we are prepared to
grant it providing all areas inside the request are either
- free, reservations, or file mappings belonging to the client.
- In other words we are prepared to let the client trash its own
+ free, reservations, or mappings belonging to the client. In
+ other words we are prepared to let the client trash its own
mappings if it wants to.
+
+ Similarly, a hinted client map will be granted at the
+ requested address providing the same conditions hold.
+
*/
Int i, j;
Addr holeStart, holeEnd, holeLen;
@@ -1567,13 +1571,14 @@
=20
/* ------ Implement Policy Exception #1 ------ */
=20
- if (forClient && req->rkind =3D=3D MFixed) {
+ if (forClient && (req->rkind =3D=3D MFixed || req->rkind =3D=3D MHint=
)) {
Int iLo =3D find_nsegment_idx(reqStart);
Int iHi =3D find_nsegment_idx(reqEnd);
Bool allow =3D True;
for (i =3D iLo; i <=3D iHi; i++) {
if (nsegments[i].kind =3D=3D SkFree
|| nsegments[i].kind =3D=3D SkFileC
+ || nsegments[i].kind =3D=3D SkAnonC
|| nsegments[i].kind =3D=3D SkResvn) {
/* ok */
} else {
@@ -1582,11 +1587,16 @@
}
}
if (allow) {
+ /* Acceptable. Granted. */
*ok =3D True;
return reqStart;
}
- *ok =3D False;
- return 0;
+ /* Not acceptable. Fixed fails, Hint is now attempted by the
+ default policy. */
+ if (req->rkind =3D=3D MFixed) {
+ *ok =3D False;
+ return 0;
+ }
}
=20
/* ------ Implement the Default Policy ------ */
|