FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Why would we use a pre-allocated pool of list nodes for the observers? · Issue #367 · munificent/game-programming-patterns · GitHub

Repository navigation

Why would we use a pre-allocated pool of list nodes for the observers? #367

Description

He says earlier (on p.46) in the observer chapter that you would usually use a dynamically sized collection for the observer pointers instead of a "dumb array", so that you don't have to use a compile-time constant for the max amount of observers a subject can have watching it.
But then later (on p.53), he says that in order to avoid dynamically allocating the list nodes you should use a pre-allocated pool of list nodes. This confuses me, aren't we back to the same problem we had earlier when we had a fixed array of observer pointers? With a pre-allocated pool, we have to decide on a maximum number of observers for not just one subject, but for the whole program. How is that sustainable?

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL