OSDN Git Service

Tweak MemoryBuffer to allocate the class itself, the name and possibly the
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 25 Jun 2010 11:50:40 +0000 (11:50 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 25 Jun 2010 11:50:40 +0000 (11:50 +0000)
commit0d7373da6af3a9578bc5f977d226f12d37b2d992
tree5c2b959fcc12b5182b74682df1b4e3784b4d3032
parent663ba35dfec121ff9154a5941d6c2b592af5843d
Tweak MemoryBuffer to allocate the class itself, the name and possibly the
buffer in the same chunk of memory.

2 less mallocs for every uninitialized MemoryBuffer and 1 less malloc for every
MemoryBuffer pointing to a memory range translate into 20% less mallocs on
clang -cc1 -Eonly Cocoa_h.m.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106839 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/MemoryBuffer.h
lib/Support/MemoryBuffer.cpp