Skip to content

[FEATURE] Requirement of a custom memory allocator + custom smart pointer implementation #4

Open

Description

@shreyaspranav

As of now, the game engine uses the default new and delete operators to dynamically allocate and free memory. As the project becomes larger with bigger systems, there is a requirement of a custom memory allocator. Certain systems such as the asset system will benefit from this as there are a lot of memory allocations involved in handling assets.

Features required in the custom memory allocator

  • Custom operators for allocating and freeing memory in the heap with fast allocation and deallocation.
  • Allocator must be optimized for current use case (i.e., mostly asset management. Will later explore the other use cases)
  • The custom memory allocators must be used with the other STL containers and algorithms.
  • Custom implementation of smart pointers (such as std::shared_ptr) with a reference counting system.
  • Means of debugging memory allocations and possible memory leaks using external tools such as Valgrind.

By implementing a custom allocator with these features, the asset system and other systems will benefit from better control over how memory is used, all while maintaining compatibility with existing C++ containers and tools.

Activity

  1. added
    enhancement
    help wanted
    on Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions