3 ms·
well, the problem is that the mmapped file is based at a different address every time you mmap it. (in realistic situations, and the general case) thus, every
by amelius 12y ago
well, the problem is that the mmapped file is based at a different address every time you mmap it. (in realistic situations, and the general case)
thus, every pointer dereference needs a base address. how is the support for this?
- xxxyy 12y agoThis is not an easy way to serialize objects, it is merely a way to help virtual memory manager recognize portions of memory that can be saved to disk in the first place. .so files are loaded through mmap, and the pointers problem is solved there through the mechanism of relocations. But please don't write raw memory objects to disk, use Google Protobuf or ASN.1