Skip to content
Permalink
Browse files
2010-10-25 Andras Becsi <abecsi@webkit.org>
        Reviewed by Csaba Osztrogonác.

        [Qt] Fix the WebKit2 build after sheriffbot messed up the rollout patch.
        https://bugs.webkit.org/show_bug.cgi?id=48238

        * Shared/qt/MappedMemory.h: Renamed from WebKit2/Platform/qt/MappedMemoryPool.h.
        (WebKit::MappedMemory::mapSize):
        (WebKit::MappedMemory::markUsed):
        (WebKit::MappedMemory::markFree):
        (WebKit::MappedMemory::isFree):
        (WebKit::MappedMemory::data):


Canonical link: https://commits.webkit.org/60993@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
bbandix committed Oct 25, 2010
1 parent 9fea225 commit a49a132905c0e83e35ba871b3f4c5666795c72cb
Showing 2 changed files with 43 additions and 32 deletions.
@@ -1,3 +1,17 @@
2010-10-25 Andras Becsi <abecsi@webkit.org>

Reviewed by Csaba Osztrogonác.

[Qt] Fix the WebKit2 build after sheriffbot messed up the rollout patch.
https://bugs.webkit.org/show_bug.cgi?id=48238

* Shared/qt/MappedMemory.h: Renamed from WebKit2/Platform/qt/MappedMemoryPool.h.
(WebKit::MappedMemory::mapSize):
(WebKit::MappedMemory::markUsed):
(WebKit::MappedMemory::markFree):
(WebKit::MappedMemory::isFree):
(WebKit::MappedMemory::data):

2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r70450.
@@ -25,49 +25,46 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MappedMemoryPool_h
#define MappedMemoryPool_h
#ifndef MappedMemory_h
#define MappedMemory_h

#include <QCoreApplication>
#include <QFile>
#include <wtf/Vector.h>

namespace WebKit {
struct MappedMemory {
QFile* file;
struct Data {
uint32_t isFree; // keep bytes aligned
uchar bytes;
};
union {
uchar* mappedBytes;
Data* dataPtr;
};
size_t dataSize;

size_t mapSize() const { return dataSize + sizeof(Data); }
void markUsed() { dataPtr->isFree = false; }
void markFree() { dataPtr->isFree = true; }
bool isFree() const { return dataPtr->isFree; }
uchar* data() const { return &dataPtr->bytes; }
};

class MappedMemoryPool {
class MappedMemoryPool : public QObject {
Q_OBJECT
public:
static MappedMemoryPool* instance();

struct MappedMemory {
QFile* file;
struct Data {
uint32_t isFree; // keep bytes aligned
uchar bytes;
};
union {
uchar* mappedBytes;
Data* dataPtr;
};
size_t dataSize;

size_t mapSize() const { return dataSize + sizeof(Data); }
void markUsed() { dataPtr->isFree = false; }
void markFree() { dataPtr->isFree = true; }
bool isFree() const { return dataPtr->isFree; }
uchar* data() const { return &dataPtr->bytes; }
};

MappedMemory* mapMemory(size_t size, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
MappedMemory* mapFile(QString fileName, size_t size, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
MappedMemory* searchForMappedMemory(uchar* p);
size_t size() const;
MappedMemory& at(size_t i);
MappedMemory& append(const MappedMemory&);

private:
MappedMemoryPool() { };
MappedMemoryPool();
Q_SLOT void cleanUp();

Vector<MappedMemory> m_pool;
};

typedef MappedMemoryPool::MappedMemory MappedMemory;

} // namespace WebKit

#endif // MappedMemoryPool_h
#endif // MappedMemory_h

0 comments on commit a49a132

Please sign in to comment.