You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: