Commit 1c2878d2 authored by andersca@apple.com's avatar andersca@apple.com

Remove a workaround for a bug in malloc on Symbian

https://bugs.webkit.org/show_bug.cgi?id=124069

Reviewed by Sam Weinig.

* Platform/CoreIPC/ArgumentDecoder.cpp:
(CoreIPC::ArgumentDecoder::~ArgumentDecoder):
(CoreIPC::ArgumentDecoder::initialize):
* Platform/CoreIPC/ArgumentDecoder.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent edea3428
2013-11-08 Anders Carlsson <andersca@apple.com>
Remove a workaround for a bug in malloc on Symbian
https://bugs.webkit.org/show_bug.cgi?id=124069
Reviewed by Sam Weinig.
* Platform/CoreIPC/ArgumentDecoder.cpp:
(CoreIPC::ArgumentDecoder::~ArgumentDecoder):
(CoreIPC::ArgumentDecoder::initialize):
* Platform/CoreIPC/ArgumentDecoder.h:
2013-11-08 Anders Carlsson <andersca@apple.com>
More build fixes.
......
......@@ -45,8 +45,8 @@ ArgumentDecoder::ArgumentDecoder(const uint8_t* buffer, size_t bufferSize, Vecto
ArgumentDecoder::~ArgumentDecoder()
{
ASSERT(m_allocatedBase);
free(m_allocatedBase);
ASSERT(m_buffer);
free(m_buffer);
#if !USE(UNIX_DOMAIN_SOCKETS)
// FIXME: We need to dispose of the mach ports in cases of failure.
#else
......@@ -67,11 +67,9 @@ static inline uint8_t* roundUpToAlignment(uint8_t* ptr, unsigned alignment)
void ArgumentDecoder::initialize(const uint8_t* buffer, size_t bufferSize)
{
// This is the largest primitive type we expect to unpack from the message.
const size_t expectedAlignment = sizeof(uint64_t);
m_allocatedBase = static_cast<uint8_t*>(malloc(bufferSize + expectedAlignment));
m_buffer = roundUpToAlignment(m_allocatedBase, expectedAlignment);
ASSERT(!(reinterpret_cast<uintptr_t>(m_buffer) % expectedAlignment));
m_buffer = static_cast<uint8_t*>(malloc(bufferSize));
ASSERT(!(reinterpret_cast<uintptr_t>(m_buffer) % alignof(uint64_t)));
m_bufferPos = m_buffer;
m_bufferEnd = m_buffer + bufferSize;
......
......@@ -99,7 +99,6 @@ protected:
bool bufferIsLargeEnoughToContain(unsigned alignment, size_t size) const;
private:
uint8_t* m_allocatedBase;
uint8_t* m_buffer;
uint8_t* m_bufferPos;
uint8_t* m_bufferEnd;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment