/[pkgs]/devel/ElectricFence/ElectricFence-2.2.2-madvise.patch
ViewVC logotype

Contents of /devel/ElectricFence/ElectricFence-2.2.2-madvise.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Oct 16 17:15:22 2004 UTC (5 years, 1 month ago) by jakub
Branch: MAIN
CVS Tags: F-12-split, F-7-split, FC-5-split, ElectricFence-2_2_2-25_fc9, F-10-split, F-11-split, ElectricFence-2_2_2-25, ElectricFence-2_2_2-22, ElectricFence-2_2_2-23, ElectricFence-2_2_2-20, ElectricFence-2_2_2-26_fc11, F-9-split, RHEL-4-split, FC-6-split, F-8-split, FC-3-split, ElectricFence-2_2_2-20_1, ElectricFence-2_2_2-27_fc12, ElectricFence-2_2_2-20_2, FC-4-split, ElectricFence-2_2_2-19, ElectricFence-2_2_2-20_2_1, ElectricFence-2_2_2-20_2_2, HEAD
File MIME type: text/x-patch
2.2.2-19
1 --- ElectricFence-2.2.2/page.c.jj 1999-04-11 17:45:26.000000000 -0400
2 +++ ElectricFence-2.2.2/page.c 2004-10-16 12:30:10.000000000 -0400
3 @@ -160,8 +160,9 @@ Page_DenyAccess(void * address, size_t s
4 void
5 Page_Delete(void * address, size_t size)
6 {
7 - if ( munmap((caddr_t)address, size) < 0 )
8 - Page_DenyAccess(address, size);
9 + Page_DenyAccess(address, size);
10 + /* Tell the kernel we will never need it again. */
11 + madvise(address, size, MADV_DONTNEED);
12 }
13
14 #if defined(_SC_PAGESIZE)
15 --- ElectricFence-2.2.2/efence.c.jj 1999-04-12 21:00:49.000000000 -0400
16 +++ ElectricFence-2.2.2/efence.c 2004-10-16 13:11:30.000000000 -0400
17 @@ -626,10 +626,7 @@ memalign(size_t alignment, size_t userSi
18 address += internalSize - bytesPerPage;
19
20 /* Set up the "dead" page. */
21 - if ( EF_PROTECT_FREE )
22 - Page_Delete(address, bytesPerPage);
23 - else
24 - Page_DenyAccess(address, bytesPerPage);
25 + Page_Delete(address, bytesPerPage);
26
27 /* Figure out what address to give the user. */
28 address -= userSize;
29 @@ -643,11 +640,8 @@ memalign(size_t alignment, size_t userSi
30 address = (char *)fullSlot->internalAddress;
31
32 /* Set up the "dead" page. */
33 - if ( EF_PROTECT_FREE )
34 - Page_Delete(address, bytesPerPage);
35 - else
36 - Page_DenyAccess(address, bytesPerPage);
37 -
38 + Page_Delete(address, bytesPerPage);
39 +
40 address += bytesPerPage;
41
42 /* Set up the "live" page. */
43 @@ -777,10 +771,7 @@ free(void * address)
44 * in the hope that the swap space attached to those pages will be
45 * released as well.
46 */
47 - if ( EF_PROTECT_FREE )
48 - Page_Delete(slot->internalAddress, slot->internalSize);
49 - else
50 - Page_DenyAccess(slot->internalAddress, slot->internalSize);
51 + Page_Delete(slot->internalAddress, slot->internalSize);
52
53 previousSlot = slotForInternalAddressPreviousTo(slot->internalAddress);
54 nextSlot = slotForInternalAddress(

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2