Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make the list (vector) of entities a contiguos array of objects #1

Copy link
Copy link

Description

@feresr
Issue body actions

World::entities is a vector of pointers, those pointers could be scattered in memory. Iterating over them might result in poor usage of CPU caches.

I tried changing std::vector<Entity*> entities; to std::vector<Entity> entities; but other problems arose. (Namely some systems might keep a pointer to a specific entity, the pointer becomes a dangling pointer when adding/removing items to the vector invalidates them)

I think my own inexperience with CPP is showing here, I'll revisit this when I feel more comfortable with it

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.