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

improve: ObjectPool to Dynamic Allocation and update condition creation #3242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dudantas
Copy link
Member

Description

This commit refactors the ObjectPool implementation to support dynamic allocation without requiring a fixed capacity. It updates the Condition::createCondition method to use the new dynamic pool for all condition types. The refactor improves memory reuse and provides a more flexible design for future scalability.

Behaviour

Actual

The ObjectPool required a fixed capacity (1024), limiting its flexibility and causing issues with scaling.

Expected

The ObjectPool now dynamically allocates objects as needed, eliminating the need for a fixed capacity.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Manual testing with multiple condition types to verify proper allocation and deallocation.
  • Reviewed performance under high load to ensure dynamic pooling works as expected.

Test Configuration:

  • Server Version: Canary MMORPG Emulator (Latest)
  • Client: Not specified
  • Operating System: Windows/Linux

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@dudantas dudantas force-pushed the dudantas/improve-object-pool branch from 12c4f73 to 842f085 Compare January 11, 2025 16:22
… creation

Updated ObjectPool to support dynamic object allocation without a fixed capacity.

Modified the Condition::createCondition function to utilize the new dynamic ObjectPool.

Improved memory management and reduced dependency on predefined pool sizes.

Enhanced flexibility for object allocation and reuse.

improve: add documentation

Code format - (Clang-format)
@dudantas dudantas force-pushed the dudantas/improve-object-pool branch from 9b0e6a3 to 6b0388d Compare January 14, 2025 21:58
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 this pull request may close these issues.

3 participants