2021-04-02 10:23 GMT+02:00, De W <
hjhjbet...@gmail.com>:
> Thank you so much for your work, it helps me a lot, the second question is
> clear to me now.
> But according to my understanding, an array is basically a constant
> pointer, point to the first element of the array. So you actually store a
> constant pointer, not its content. Please correct me if i am wrong.
>
> Vào lúc 14:46:41 UTC+7 ngày Thứ Sáu, 2 tháng 4, 2021, Igor Chorążewicz đã
> viết:
>
>> Actually 'entries' is not a pointer, it's an array (so, data is stored
>> inline in the leaf).
>>
>> The B tree implementation might not be the best data structure to look at
>>
>> when you you're trying to understand libpmemobj-cpp. There are some
>> optimizations which can make code harder to understand. I would recommend
>>
>> looking at some simpler data structures first, e.g. :
>>
https://github.com/pmem/libpmemobj-cpp/blob/master/examples/queue/queue.cpp
>>
>> You can find pretty good explanation of this example (and how to convert
>> DRAM data structure to a pmem one) in the book:
https://pmem.io/book/ in
>> chapter 8 (it also explains why using regular pointers on pmem is not a
>> good idea).
>>
>> As for the second question: "And how can it roll back on failure?"
>> In general, to make sure modifications of some variable are power-fail
>> atomic you use:
>> * pmem::obj::p
>>>>>>>
>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "pmem" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>>
>>>>> an email to
pmem+uns...@googlegroups.com.
>>>>>
>>>> To view this discussion on the web visit
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google Groups
>>>
>>> "pmem" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>
>>> email to
pmem+uns...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pmem" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
pmem+uns...@googlegroups.com.
> To view this discussion on the web visit