On Apr 13, 2010, at 8:39 PM, Chris Lattner wrote:

> 
> On Apr 13, 2010, at 4:39 PM, Ted Kremenek wrote:
> 
>> Author: kremenek
>> Date: Tue Apr 13 18:39:09 2010
>> New Revision: 101194
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=101194&view=rev
>> Log:
>> Introduce ASTVector, which is a std::vector-like class that allocates all 
>> memory
>> using the allocator associated with an ASTContext.  This is largely 
>> copy-and-paste
>> from SmallVector, and should be refactored one day.
> 
> It shouldn't be too hard to make SmallVector use an Allocator, would it?

No; I think this class is evidence of that, since it's largely the same logic.

I think the trick would be in keeping the allocator argument optional if one 
could specify a default allocator (e.g., a MallocAllocator) so that existing 
SmallVector clients wouldn't be forced to change.  I don't think it would be 
too difficult.

My main intent of doing 'ASTVector' first was to try the idea out, see that 
there was no fallout, and then do the refactoring.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to