Summary:
It is dangerous to pass memory into an IOBuf since usually in C++
programs, memory is allocated using `new`, while IOBuf by default frees
memory that it has taken ownership of with `free()`. For now, add a
comment warning about this (address sanitizer will warn you about this
when it happens in a live process).
Test Plan: NA
Reviewed By: tudorb@fb.com
FB internal diff:
D990056
@override-unit-failures
* buffer as the first argument, and the supplied userData value as the
* second argument. The free function must never throw exceptions.
*
- * If no FreeFunction is specified, the buffer will be freed using free().
+ * If no FreeFunction is specified, the buffer will be freed using free()
+ * which will result in undefined behavior if the memory was allocated
+ * using 'new'.
*
* The IOBuf data pointer will initially point to the start of the buffer,
*