What is pointer swizzling? What is pointer swizzling? c c

What is pointer swizzling?


The wikipedia page explains this, but let me say it another way.

Say you have a binary tree data structure in memory and want to save the structure to disk.You can not simply write the structure to disk because the pointers will be invalid on disk.Also when you later want to read the binary tree from disk back into memory, the addressesused in the original memory copy of the tree might already be in use in the new process.

Pointer swizzling is converting pointers to handles when writing from memory to disk,and also converting handles to (different) pointers when reading the disk data back into memory.