[Lldb-commits] [PATCH] D30054: Delete DataBufferMemoryMap

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 23 12:39:59 PST 2017


zturner updated this revision to Diff 89547.
zturner added a comment.

Updated with suggestions from clayborg at .  It seems wasteful to me check the pointer on every single call to read when we can check it once on creation.  So I've added an assert in the constructor and documented with doxygen comments that the class should not be constructed with a non-null `MemoryBuffer`.  i.e. it's the caller's responsibility to ensure the pointer is not null.

Note that when creating one from a path using the supplied static functions, this is not an issue since it will never create one with a null pointer anyway.

I would prefer to avoid superfluous null pointer checks, so hopefully this is sufficient.


https://reviews.llvm.org/D30054

Files:
  lldb/include/lldb/Core/DataBufferHeap.h
  lldb/include/lldb/Core/DataBufferLLVM.h
  lldb/include/lldb/Core/DataBufferMemoryMap.h
  lldb/include/lldb/Host/FileSpec.h
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/DataBufferLLVM.cpp
  lldb/source/Core/DataBufferMemoryMap.cpp
  lldb/source/Host/common/FileSpec.cpp
  lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/unittests/Process/minidump/MinidumpParserTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30054.89547.patch
Type: text/x-patch
Size: 59564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170223/d2d91a8a/attachment-0001.bin>


More information about the lldb-commits mailing list