Add a comment about takeOwnership()
authorDaniel Sommermann <dcsommer@fb.com>
Mon, 30 Sep 2013 21:02:07 +0000 (14:02 -0700)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:44:21 +0000 (18:44 -0700)
commit524d0e74dbcd615e3704be2a119cd63f6c69d3fd
treeeb0a1ed6057e4faec87c6628a78c286ea475d146
parent762965ce25c73623845d3075111b565421dcc608
Add a comment about takeOwnership()

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
folly/io/IOBuf.h