摘要 |
A smart pointer contains two based addresses which are offsets relative to the start of a shared memory heap. One of the based addresses, a destination-pointer, is the offset of a data structure in the heap pointed to by the smart pointer. The other based address, a this-pointer, is the offset of the smart pointer itself. The smart pointer has a self-referencing property which returns an absolute address of the smart pointer within the address space of a process that has opened the heap in shared memory. The absolute address of the data structure pointed to by the smart pointer is calculated by subtracting the this-pointer from the absolute address of the smart pointer and then adding the destination-pointer.
|