mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 01:55:08 +00:00
List of potential checkers: smart pointer checker: actually, unique_ptr<T[]>
will do the right thing for new[] allocated memory. Thanks David! llvm-svn: 165365
This commit is contained in:
parent
760cbe65fd
commit
67df63f69d
@ -270,8 +270,10 @@ void f() throw(int) {
|
||||
(C++)</span><br><br>
|
||||
C++03: auto_ptr should store a pointer to an object obtained via new as allocated
|
||||
memory will be cleaned using delete<br>
|
||||
C++11: unique_ptr and shared_ptr allow
|
||||
to specify a custom deleter to handle the new[]/delete[] case correctly
|
||||
C++11: one should use unique_ptr<T[]> to keep a pointer to memory
|
||||
allocated by new[]<br>
|
||||
C++11: to keep a pointer to memory allocated by new[] in a shared_ptr one
|
||||
should use a custom deleter that calls delete[]
|
||||
</td><td><pre>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
|
Loading…
Reference in New Issue
Block a user