On Tue Jul 15 19:47:21 2025 +0000, Alexander Morozov wrote:
`HeapAlloc` is not called for every device object in this loop. Only for that in which we save id + maybe one excessive. We could make `instance_id` in `wine_device` an array instead of a pointer. But then `wine_device` struct would have more size for every device, but only PDOs really have id. I do not know what is preferred.
Sorry, I thought your comment was about the change in `wine_enumerate_root_devices`. In `enumerate_new_device` I make allocation because `wine_device` contains a pointer and so we need to do the allocation anyway. The only case when this allocaction is excessive is when `get_device_instance_id` fails but this is an error case and I think it should be rarer than successful execution path.