Dear all, I am attempting to get a better understanding of the lifetime of packets, and the requests and data they point to. This is crucial to understand: 1) who is responsible for de-allocation (to avoid memory leaks), and 2) when it is safe to de-allocate (to avoid SEGFAULTS etc). It also becomes particularly interesting when multiple packets are involved in serving one request, e.g. snoop packets, or forwarded packets in one or more bridges.
The concrete example I am working with involves creating explicit snoop messages in the bus (rather than sending the same message to all snoopers). This is very similar to what is happening in the cache. The copied packets point to the same request and data as the original packet, thus allowing e.g. a cache to update the "original" location of the data, pointed to by every single copy of the packet. However, these packets are deleted after getting the state information from them (shared, inhibited etc), and at this point the original request is also deallocated through the packets destructor. How is this intended to work? Is there a rule to follow to avoid memory leaks and segfaults, even in the presence of forwarding/multiple hops with intermediate (life time during original) or succeeding packets (life time beyond original)? I hope someone can shed some light on the matter. Thanks in advance. Best regards, Andreas -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
