saprykin / plibsys

Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
MIT License
672 stars 74 forks source link

Unable create share memory more than 4GB on windows #106

Closed leekunpeng closed 2 months ago

leekunpeng commented 2 months ago

Hi~ When i use plibsys in my program, i foud it can't create a share memory which size is more than 4GB on windows. In the “pshm-win.c”, line 74. function CreateFileMappingA(), argument dwMaximumSizeHigh was set to 0. And that cause this problem. Could you fix this? Thanks. Best.

saprykin commented 2 months ago

Thanks for the PR! I have a few questions to clarify:

leekunpeng commented 2 months ago

Sorry for the delay.

I agree with you, 4GB is really not needed for testing on a windows XP machine. I added this just to test, i suggest you can remove it. But now i am using plibsys to develop cross-platform applications. Our program have a need to mem allocate 4GB of shared memory on windows. So i summit a PR. I have change LOWDWORD macro and delete 4GB mem test.

Can you please help to solve this problem? Thanks a lot!