patches/webkit-02-mmap.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 3325 33ece2659d50
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3325
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
     1
--- webkit-1.2.7/JavaScriptCore/interpreter/RegisterFile.cpp	Fri Sep 10 15:20:23 2010
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
     2
+++ webkit-1.2.7-patch/JavaScriptCore/interpreter/RegisterFile.cpp	Sat Mar 19 22:58:16 2011
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
     3
@@ -36,7 +36,7 @@
2315
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     4
 RegisterFile::~RegisterFile()
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     5
 {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     6
 #if HAVE(MMAP)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     7
-    munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     8
+    munmap((caddr_t)m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
     9
 #elif HAVE(VIRTUALALLOC)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    10
 #if OS(WINCE)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    11
     VirtualFree(m_buffer, DWORD(m_commitEnd) - DWORD(m_buffer), MEM_DECOMMIT);
3325
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    12
--- webkit-1.2.7/JavaScriptCore/interpreter/RegisterFile.h	Fri Sep 10 15:20:23 2010
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    13
+++ webkit-1.2.7-patch/JavaScriptCore/interpreter/RegisterFile.h	Sat Mar 19 22:58:16 2011
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    14
@@ -175,7 +175,7 @@
2315
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    15
 
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    16
         size_t bufferLength = (capacity + maxGlobals) * sizeof(Register);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    17
     #if HAVE(MMAP)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    18
-        m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0));
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    19
+        m_buffer = reinterpret_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0));
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    20
         if (m_buffer == MAP_FAILED) {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    21
 #if OS(WINCE)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    22
             fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
3325
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    23
--- webkit-1.2.7/JavaScriptCore/runtime/MarkStackPosix.cpp	Fri Mar 19 16:20:53 2010
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    24
+++ webkit-1.2.7-patch/JavaScriptCore/runtime/MarkStackPosix.cpp	Sat Mar 19 22:58:16 2011
2663
a8edf8722649 Remake patches
simonjin
parents: 2315
diff changeset
    25
@@ -44,7 +44,7 @@
2315
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    26
 }
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    27
 void MarkStack::releaseStack(void* addr, size_t size)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    28
 {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    29
-    munmap(addr, size);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    30
+    munmap((caddr_t)addr, size);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    31
 }
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    32
 
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    33
 }
3325
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    34
--- webkit-1.2.7/JavaScriptCore/wtf/TCSystemAlloc.cpp	Fri Sep 10 15:20:23 2010
33ece2659d50 SFEwebkitgtk.spec: bump to 1.2.7
jurikm
parents: 2663
diff changeset
    35
+++ webkit-1.2.7-patch/JavaScriptCore/wtf/TCSystemAlloc.cpp	Sat Mar 19 22:58:16 2011
2663
a8edf8722649 Remake patches
simonjin
parents: 2315
diff changeset
    36
@@ -194,10 +194,10 @@
2315
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    37
 
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    38
   // Return the unused memory to the system
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    39
   if (adjust > 0) {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    40
-    munmap(reinterpret_cast<void*>(ptr), adjust);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    41
+    munmap(reinterpret_cast<caddr_t>(ptr), adjust);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    42
   }
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    43
   if (adjust < extra) {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    44
-    munmap(reinterpret_cast<void*>(ptr + adjust + size), extra - adjust);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    45
+    munmap(reinterpret_cast<caddr_t>(ptr + adjust + size), extra - adjust);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    46
   }
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    47
 
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    48
   ptr += adjust;
2663
a8edf8722649 Remake patches
simonjin
parents: 2315
diff changeset
    49
@@ -443,7 +443,7 @@
2315
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    50
 
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    51
 void TCMalloc_SystemRelease(void* start, size_t length)
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    52
 {
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    53
-  void* newAddress = mmap(start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    54
+  void* newAddress = mmap((caddr_t)start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    55
   // If the mmap failed then that's ok, we just won't return the memory to the system.
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    56
   ASSERT_UNUSED(newAddress, newAddress == start || newAddress == reinterpret_cast<void*>(MAP_FAILED));
ef3e0baebb09 Bump webkit-cstd to 1.1.19
simonjin
parents:
diff changeset
    57
 }