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

Switch structures to use PagedEntityContainer<STRUCTURE> as backing storage #3701

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

ManManson
Copy link
Member

@ManManson ManManson commented Mar 23, 2024

Switch structures to use PagedEntityContainer as backing storage.

  • Structure storage is organized into pages of 256 entities.
  • Slot reuse is disabled due to the same underlying reasons as for droids (i.e. as an additional fail-safe against dangling pointers to structs when transitioning between missions).

No performance changes expected, except for slightly better memory utilization patterns, e.g. less memory fragmentation.

Signed-off-by: Pavel Solodovnikov [email protected]

@ManManson ManManson force-pushed the structs_optimized_storage branch from ecdd783 to ce622e1 Compare March 23, 2024 09:38
@ManManson ManManson added this to the 4.5.0-beta1 milestone Mar 23, 2024
@ManManson ManManson requested a review from past-due March 23, 2024 09:39
@ManManson
Copy link
Member Author

Xcode 13.4 (ARM64) build has been cancelled for some reason: https://github.com/Warzone2100/warzone2100/actions/runs/8400925845/job/23008739835?pr=3701
@past-due Can you restart it, please?

@past-due past-due force-pushed the structs_optimized_storage branch from ce622e1 to 97cfa40 Compare March 24, 2024 19:06
@past-due
Copy link
Member

Forced-pushed on top of latest master (including the changes from #3689), and added Clear the PagedEntityContainer<STRUCTURE> in objmemShutdown()

@ManManson
Copy link
Member Author

Seems that you've actually reverted the branch to some old state in the process ...

ManManson and others added 3 commits March 24, 2024 15:28
…g storage

1. Split the structure storage into pages containing 256 structs
2. Disable slot reuse to guard against memory-related issues
   when some object pointers won't get updated properly,
   e.g. when transitioning between the base and offworld missions.

Signed-off-by: Pavel Solodovnikov <[email protected]>
@past-due past-due force-pushed the structs_optimized_storage branch from 97cfa40 to 326aaec Compare March 24, 2024 19:30
@past-due
Copy link
Member

Should be fixed - sorry about that!

@ManManson
Copy link
Member Author

Everything seems to be OK now, thanks!

@past-due past-due merged commit c71a682 into Warzone2100:master Mar 24, 2024
38 checks passed
@ManManson ManManson deleted the structs_optimized_storage branch April 23, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants