C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make all data pointers intercompatible

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 28 Jan 2025 14:28:00 +0100
So it is class-specific and probably provided by the implementer of the class? So your requirement is  - function to pack and unpack objects  - access and knowledge to the internals of an object is a given    - the member functions do not have to work in packed form, only in unpacked form    - you have a pointer, which can point into the object or outside  - you do not want to use up more bytes (e.g. for an additional flag)  - sizeof(T*) pointer should also store a relative offset or an absolute address in packed form     Possible solutions: a) store as relative, if packed; use unused bits in the pointer to flag, whether the address is absolute or relative b) similarly, use an unused memory region for internal pointers (e.g. in packed form, do as if the object is at address 0 or at address 0xF0000000, some unused address) c) make the address always a byte-aligned relative address in packed form   Perhaps there is UB in some of the solutions   -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 28.01.2025 14:09 Betreff:Re: [std-proposals] Make all data pointers intercompatible An:std-proposals_at_[hidden]; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>; On Tue, Jan 28, 2025 at 12:40 PM Sebastian Wittmeier wrote: > > Who or what would update the pointers, when relocating? The relocation is performed on page 5 of this paper:     http://www.virjacode.com/papers/unaligned_latest.pdf Scroll down to the part that says:      // Step 4: Adjust the pointer      p += dst-src; -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals  

Received on 2025-01-28 13:31:38