Skip to content

Conversation

@Yanfeng-Mi
Copy link

…iler

The issue root-caused to the subtle difference of unique_ptr's destructor between clang and gcc:

Clang (libc++): Calls unique_ptr's destructor, which first clears the internal pointer to nullptr and then calls the deleter on the old pointer value. This means that within the destructor of the managed object, the owning unique_ptr's internal pointer is already nullified.

GCC (libstdc++): The destructor directly calls the deleter on the current pointer without first setting it to nullptr

Fix: using flag-based system to replace the problematic pointer comparison ref #744

…iler

The issue root-caused to the subtle difference of unique_ptr's destructor between
clang and gcc:

Clang (libc++): Calls unique_ptr's destructor, which first clears the internal pointer
to nullptr and then calls the deleter on the old pointer value. This means that within
the destructor of the managed object, the owning unique_ptr's internal pointer is already nullified.

GCC (libstdc++): The destructor directly calls the deleter on the current pointer without
first setting it to nullptr

Fix: using flag-based system to replace the problematic pointer comparison
ref intel#744

Signed-off-by: Mi, Yanfeng <yanfeng.mi@intel.com>
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