In our language design book, it is mentioned that GC sweep can be integrated into allocation, such that when you call
malloc for example, you sweep until you find a fitting object, which you then return (i.e. sweeping is not a different procedure).
It, however, also mentions that this is only viable when the objects all have the same size. Why is that? It seems to me that it should be possible, since the sizes of the objects are known from the metadata etc.