osvenskan / posix_ipc

Other
135 stars 24 forks source link

fix for #35: Failing memory test on aarch64 based macOS. #41

Closed rhornig closed 1 year ago

rhornig commented 1 year ago

mmap rounds the returned memory size to the memory pagesize not the filesystem blocksize. This happen to be the same on Linux and also on intel based MACs, but AARCH64 macOS has a pagesize of 16384 (while still has a filesystem block size of 4096).

This patch modifies the the test_memory.py tets file to account for this allowing to successfully pass the tests also on aarch64 based macOS mascines. The patch also reverts a previous attempt to fix the test failure: c505aea

osvenskan commented 1 year ago

Thanks @rhornig for the PR. Can you explain more about where macOS runs on aarch64? As I said in #35, I have a non-Intel Mac (specifically an M1 Pro) and I was not able to re-create the problem reported in #35.

rhornig commented 1 year ago

@osvenskan Hmm, this is strange. I just tried it on my macMini (M1) and running the test clearly failed. Are you sure you are running it in a native aarch64 terminal window and not in a rosetta emulated x86 emulation? You can also type pagesize on the terminal to see what is the reported memory page size. As strange as it looks pagesize reports 4096 in i386 mode and 16384 in arm64...