Skip to content

Free trace offload buffer objects when trace offload is destructed#48

Open
richard-byron wants to merge 3 commits intoXilinx:masterfrom
richard-byron:TraceBO-PR
Open

Free trace offload buffer objects when trace offload is destructed#48
richard-byron wants to merge 3 commits intoXilinx:masterfrom
richard-byron:TraceBO-PR

Conversation

@richard-byron
Copy link
Copy Markdown

Previously HalDevice::free was a NOP. Buffer objects still will get freed, but not until the program exits. This change implements free so that buffer objects will be released at the point free is called.

This was causing problems with some tests running out of memory for trace buffers. This change doesn't necessarily prevent that, but seems like good practice anyway.

This also changes continuousOffload so that it won't attempt to initialize trace buffers again if a call to initReadTrace has already failed. This change is not strictly necessary, but makes the code slightly easier to follow and the initial failure point easier to identify. initReadTrace is always called before startOffload (which creates the thread that continuousOffload is the entry point for), so calling it a second time should just result in a second failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant