summaryrefslogtreecommitdiff
path: root/tests/test_header_iosfwd_1.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-01-20 21:51:02 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-01-20 21:51:02 -0800
commit7f91301946ce05e79fdd2ca3e79071f79fc93ba3 (patch)
tree31d818962179c150b0f3ca501135772a44f68c2c /tests/test_header_iosfwd_1.cpp
parent7aef75f43dc59e407b6b158f126959bc5811c642 (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 'tests/test_header_iosfwd_1.cpp')
0 files changed, 0 insertions, 0 deletions