mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
Document the alignment limitation of tor_free()
This commit is contained in:
parent
f71bbd20a4
commit
519fa1a3e6
@ -79,6 +79,11 @@ extern int dmalloc_free(const char *file, const int line, void *pnt,
|
|||||||
*
|
*
|
||||||
* This is a macro. If you need a function pointer to release memory from
|
* This is a macro. If you need a function pointer to release memory from
|
||||||
* tor_malloc(), use tor_free_().
|
* tor_malloc(), use tor_free_().
|
||||||
|
*
|
||||||
|
* Note that this macro takes the address of the pointer it is going to
|
||||||
|
* free and clear. If that pointer is stored with a nonstandard
|
||||||
|
* alignment (eg because of a "packed" pragma) it is not correct to use
|
||||||
|
* tor_free().
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define tor_free(p) STMT_BEGIN \
|
#define tor_free(p) STMT_BEGIN \
|
||||||
|
Loading…
Reference in New Issue
Block a user