Amir Aslan Haghrah <amiraslanhagh...@gmail.com> added the comment:
Thank you for your response. I noticed this issue while working with 'mmap' and memory sharing. As you said I check it in 'C++' and I got the same result for my struct as Python. --------------------------------------------------------------------- I used the 'sizeof' function to calculate my struct size to read it from mapped memory and I get wrong output in reading memory because of this aligning procedure. Question: Structs map to memory unaligned but sizeof return the aligned size of struct. How we can calculate the sizeof struct to use it in reading from memory? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35562> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com