vi
Typed Object Identifiers (TOIDs) �������������������������������������������������������������������������������������������������� 92
Allocating Memory ���������������������������������������������������������������������������������������������������������������������� 93
Persisting Data ���������������������������������������������������������������������������������������������������������������������������� 94
Atomic Operations ����������������������������������������������������������������������������������������������������������������� 94
Reserve/Publish API��������������������������������������������������������������������������������������������������������������� 97
Transactional API ����������������������������������������������������������������������������������������������������������������� 100
Optional Flags ���������������������������������������������������������������������������������������������������������������������� 104
Persisting Data Summary ���������������������������������������������������������������������������������������������������� 104
Guarantees of libpmemobj’s APIs ��������������������������������������������������������������������������������������������� 105
Managing Library Behavior ������������������������������������������������������������������������������������������������������� 106
Debugging and Error Handling �������������������������������������������������������������������������������������������������� 106
Summary����������������������������������������������������������������������������������������������������������������������������������� 108
Chapter 8: libpmemobj-cpp: The Adaptable Language - C++ and
Persistent Memory ����������������������������������������������������������������������������������������������� 111
Introduction ������������������������������������������������������������������������������������������������������������������������������� 111
Metaprogramming to the Rescue ��������������������������������������������������������������������������������������������� 112
Persistent Pointers �������������������������������������������������������������������������������������������������������������� 112
Transactions ������������������������������������������������������������������������������������������������������������������������ 113
Snapshotting ����������������������������������������������������������������������������������������������������������������������� 115
Allocating ����������������������������������������������������������������������������������������������������������������������������� 116
C++ Standard limitations ���������������������������������������������������������������������������������������������������������� 118
An Object’s Lifetime������������������������������������������������������������������������������������������������������������� 119
Trivial Types ������������������������������������������������������������������������������������������������������������������������� 120
Object Layout ����������������������������������������������������������������������������������������������������������������������� 122
Pointers ������������������������������������������������������������������������������������������������������������������������������� 123
Limitations Summary ���������������������������������������������������������������������������������������������������������� 125
Persistence Simplified �������������������������������������������������������������������������������������������������������������� 126
The Ecosystem �������������������������������������������������������������������������������������������������������������������������� 133
Persistent Containers ���������������������������������������������������������������������������������������������������������� 134
Examples of Persistent Containers �������������������������������������������������������������������������������������� 135
Summary����������������������������������������������������������������������������������������������������������������������������������� 138
Table of ConTenTs
Précédent

- 7/457

Suivant