<div dir="rtl"><div dir="ltr">>This commit was about raw_svector_ostream always allocating 128 bytes<br>>when its created, rendering the 60 bytes of inline storage completely<br>>useless. This is very annoying but I have no idea how to fix it.</div><div dir="ltr"><br></div><div dir="ltr">The patch for raw_svector_ostream I posted on llvm-commits fixes this issue as well as making raw_svector_ostream faster, if you'd like to review it.</div><div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br><br>2015-05-28 12:48 GMT+03:00 Benjamin Kramer <<a href="mailto:benny.kra@gmail.com">benny.kra@gmail.com</a>>:<br>><br>> On Thu, May 28, 2015 at 3:25 AM, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br>> ><br>> ><br>> > On Wed, May 27, 2015 at 6:24 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br>> >><br>> >> I've always thought that it was confusing that SmallString internally did<br>> >> so much processing on the number you give it to actually choose the buffer<br>> >> size. Maybe we can just static_assert it is a power of 2 so it is always<br>> >> WYSIWYG?<br>> ><br>> ><br>> > (and all the other conditions it does, such as requiring 0 to mean "no<br>> > buffer")<br>><br>> Does it really modify the buffer size internally? I thought it just<br>> forwarded to SmallVector, which shouldn't be restricted to powers of<br>> 2.<br>><br>> This commit was about raw_svector_ostream always allocating 128 bytes<br>> when its created, rendering the 60 bytes of inline storage completely<br>> useless. This is very annoying but I have no idea how to fix it.<br>><br>> - Ben<br>><br>> >><br>> >> On Sat, May 23, 2015 at 10:20 AM, Benjamin Kramer<br>> >> <<a href="mailto:benny.kra@googlemail.com">benny.kra@googlemail.com</a>> wrote:<br>> >>><br>> >>> Author: d0k<br>> >>> Date: Sat May 23 12:20:53 2015<br>> >>> New Revision: 238104<br>> >>><br>> >>> URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238104-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=B9R990eS5DPnrTOvLiMZXjDHSy-6njIDGgnCwM7Zyss&s=ni6mOTIsHwZAAcaE4SqTa2cxzDg_jRBEgXZn-cZF5Fk&e=">http://llvm.org/viewvc/llvm-project?rev=238104&view=rev</a><br>> >>> Log:<br>> >>> Bump SmallString to the minimum required amount for raw_ostream to avoid<br>> >>> allocation.<br>> >>><br>> >>> NFC.<br>> >>><br>> >>> Modified:<br>> >>>     llvm/trunk/lib/Target/TargetMachine.cpp<br>> >>><br>> >>> Modified: llvm/trunk/lib/Target/TargetMachine.cpp<br>> >>> URL:<br>> >>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Target_TargetMachine.cpp-3Frev-3D238104-26r1-3D238103-26r2-3D238104-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=B9R990eS5DPnrTOvLiMZXjDHSy-6njIDGgnCwM7Zyss&s=rH7eAiCgCq0wevHNOuORkB4Sjm_xRAPAYwxh1yrHtEU&e=">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=238104&r1=238103&r2=238104&view=diff</a><br>> >>><br>> >>> ==============================================================================<br>> >>> --- llvm/trunk/lib/Target/TargetMachine.cpp (original)<br>> >>> +++ llvm/trunk/lib/Target/TargetMachine.cpp Sat May 23 12:20:53 2015<br>> >>> @@ -185,7 +185,7 @@ void TargetMachine::getNameWithPrefix(Sm<br>> >>>  }<br>> >>><br>> >>>  MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang)<br>> >>> const {<br>> >>> -  SmallString<60> NameStr;<br>> >>> +  SmallString<128> NameStr;<br>> >>>    getNameWithPrefix(NameStr, GV, Mang);<br>> >>>    const TargetLoweringObjectFile *TLOF = getObjFileLowering();<br>> >>>    return TLOF->getContext().getOrCreateSymbol(NameStr);<br>> >>><br>> >>><br>> >>> _______________________________________________<br>> >>> llvm-commits mailing list<br>> >>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>> >>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>> >><br>> >><br>> ><br>> _______________________________________________<br>> llvm-commits mailing list<br>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></div>