Keep PersistentValueStorage page size in sync with system page size
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>
Fri, 30 Jan 2015 14:54:58 +0000 (15:54 +0100)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Mon, 2 Feb 2015 07:16:29 +0000 (07:16 +0000)
commitd302abb3d056a1ae0997ef03f442bfbd6547be0c
treed6bf4fb39d1f3325a04cf37534697b46af83a89d
parent8d0304177297fc2a66820bc5caab7244520c87fb
Keep PersistentValueStorage page size in sync with system page size

WTF::PageAllocation::allocate() requires the allocated size to be a
multiple of the system page size (available through WTF::pageSize()),
so we can't hard-code the page size in PersistentValueStorage to 4K.

As we control the memory of the page we can use 'Value values[1]' as
a trick to let the compiler set up a head-reference for our list of
Values, which we access by values[0:kEntriesPerPage - 1].

Change-Id: I71fdfffa0424d510fc1073bb67b6675a04ac2d80
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/jsruntime/qv4persistent.cpp