webkit-1.8.0-2: Patches for review
Source: webkit
Version: 1.8.0-2
Severity: Important
Tags: hurd
User: debian-hurd@lists.debian.org
Managed to build webkit with 2G of RAM, and 2.6G of swap. Total disk
size around 10G. The files libwebkitgtk-1.0.so.0.13.1 and
libwebkitgtk-3.0.so.0.13.1 are around 1G each! (unstripped) Couldn't
these libraries be made smaller (modularized??)
Problem with the patch is that the allocated string cannot easily be
freed:
CString::CString(const char* str, size_t length)
{
init(str, length);
}
void CString::init(const char* str, size_t length)
{
if (!str)
return;
...
m_buffer = CStringBuffer::create(length + 1);
memcpy(m_buffer->mutableData(), str, length);
m_buffer->mutableData()[length] = '\0';
}
The string str is declared const char* and I don't want to change that
definition. Maybe leaving the string allocated won't cause any problems?
.../FileSystemGtk.cpp:
CString applicationDirectoryPath()
{
CString path = getCurrentExecutablePath();
if (!path.isNull())
return path;
.../ProcessLauncherGtk.cpp:
CString executableFile = getCurrentExecutablePath();
if (!executableFile.isNull())
executablePath =
directoryName(filenameToString(executableFile.data()));
--- a/Source/ThirdParty/ANGLE/src/compiler/osinclude.h 2012-02-19 18:47:57.000000000 +0100
+++ b/Source/ThirdParty/ANGLE/src/compiler/osinclude.h 2012-04-15 09:20:30.000000000 +0200
@@ -16,7 +16,7 @@
#define ANGLE_OS_WIN
#elif defined(__APPLE__) || defined(__linux__) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || \
- defined(__sun) || defined(ANDROID)
+ defined(__sun) || defined(ANDROID) || defined(__GNU__)
#define ANGLE_OS_POSIX
#else
#error Unsupported platform.
--- a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-02-19 18:45:45.000000000 +0100
+++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-04-16 14:23:16.000000000 +0200
@@ -25,6 +25,8 @@
#include <wtf/text/WTFString.h>
#else
#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#endif
@@ -40,9 +42,14 @@
#elif OS(UNIX)
CString getCurrentExecutablePath()
{
- static char readLinkBuffer[PATH_MAX];
- ssize_t result = readlink("/proc/curproc/file", readLinkBuffer, PATH_MAX);
- if (result == -1)
+ struct stat sb;
+ char *readLinkBuffer;
+ ssize_t result;
+ result = lstat("/proc/curproc/file", &sb);
+ readLinkBuffer = (char*)malloc(sb.st_size + 1);
+ if (readLinkBuffer == NULL) return CString();
+ result = readlink("/proc/curproc/file", readLinkBuffer, sb.st_size + 1);
+ if (result == -1 || result > sb.st_size)
return CString();
return CString(readLinkBuffer, result);
}
Reply to: