Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
leekunpeng opened this issue Apr 17, 2024 · 2 comments · Fixed by #107
Closed

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

leekunpeng opened this issue Apr 17, 2024 · 2 comments · Fixed by #107

Comments

@leekunpeng
Copy link
Contributor

leekunpeng commented Apr 17, 2024

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.

@leekunpeng leekunpeng changed the title Unable create share memory more than 4GB on Unable create share memory more than 4GB on windows Apr 17, 2024
@saprykin
Copy link
Owner

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

  • Maybe we should not have a test for 4GB. My concern is what would happen on Windows XP with less than 4 GB? Some embedded machines may also have less than 4GB of physical memory available. There is a clear problem with Windows API usage (what PR is fixing), but I would prefer to avoid having extreme test cases which potentially cannot be run on low-performance machines.
  • In LOWDWORD macro, why do you need to do shifts at all? I guess you can just cut high word like this: #define LODWORD(l) ((DWORD)((DWORDLONG)(l)))

@leekunpeng
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants