Fix a SEGV when running --roctx-trace
There's a typo in RegisterApiCallback, roctx::cb_table.Get should be roctx::cb_table.Set. Change-Id: I47ec8ac666f783ff4e03f35d13e375e645899900
This commit is contained in:
zatwierdzone przez
Laurent Morichetti
rodzic
7f05496a87
commit
0d7d56eea5
@@ -45,6 +45,7 @@ template <uint32_t N> class CallbackTable {
|
||||
|
||||
void Get(uint32_t id, activity_rtapi_callback_t* callback, void** arg) const {
|
||||
assert(id < N && "id is out of range");
|
||||
assert(callback != nullptr && arg != nullptr && "invalid arguments");
|
||||
std::lock_guard lock(mutex_);
|
||||
std::tie(*callback, *arg) = callbacks_[id];
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ PUBLIC_API bool RegisterApiCallback(uint32_t op, void* callback, void* arg) {
|
||||
|
||||
PUBLIC_API bool RemoveApiCallback(uint32_t op) {
|
||||
if (op >= ROCTX_API_ID_NUMBER) return false;
|
||||
roctx::cb_table.Get(op, NULL, NULL);
|
||||
roctx::cb_table.Set(op, nullptr, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user