diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-01-20 21:51:02 -0800 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-01-20 21:51:02 -0800 |
commit | 7f91301946ce05e79fdd2ca3e79071f79fc93ba3 (patch) | |
tree | 31d818962179c150b0f3ca501135772a44f68c2c /docs/samples/include.cpp | |
parent | 7aef75f43dc59e407b6b158f126959bc5811c642 (diff) |
Change header format in non-compact mode to store page offset
This utilizes the fact that pages are of limited size so we can store offset
from the object to the page in a few bits - we currently use 24 although that's
excessive given that pages are limited to ~512k.
This has several benefits:
- Pages do not have to be 64b aligned any more - this simplifies allocation flow
and frees up 40-50 bytes from xml_document::_memory.
- Header now has 8 bits available for metadata for both compact and default mode
which makes it possible to store type as-is (allowing easy type extension and
removing one add/sub operation from type checks).
- One extra bit is easily available for future metadata extension (in addition
to the bit for type encoding that could be reclaimed if necessary).
- Allocators that return 4b-aligned memory on 64-bit platforms work fine if
misaligned reads are supported.
The downside is that there is one or two extra instructions on the allocation
path. This does not seem to hurt parsing performance.
Diffstat (limited to 'docs/samples/include.cpp')
0 files changed, 0 insertions, 0 deletions