diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-17 18:46:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-17 18:46:59 +0000 |
commit | ee8fed0146eb78c29cee02a1c610f46708ca1864 (patch) | |
tree | 8045696aeade251f50c418e8e1155a7e7d72ea7d /clang | |
parent | 5a00b19a29c1762b21f685d300c926cae47fe045 (diff) | |
download | bcm5719-llvm-ee8fed0146eb78c29cee02a1c610f46708ca1864.tar.gz bcm5719-llvm-ee8fed0146eb78c29cee02a1c610f46708ca1864.zip |
Reduce the default alignment for ASTContext and Stmt/Expr allocation
from 16 bytes to 8 bytes, since we don't ever use those low 4
bits. Should save some storage.
llvm-svn: 98754
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/AST/ASTContext.h | 10 | ||||
-rw-r--r-- | clang/include/clang/AST/Stmt.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index efd70badc9c..78b808c1443 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1317,10 +1317,10 @@ static inline Selector GetUnarySelector(const char* name, ASTContext& Ctx) { /// this ever changes, this operator will have to be changed, too.) /// Usage looks like this (assuming there's an ASTContext 'Context' in scope): /// @code -/// // Default alignment (16) +/// // Default alignment (8) /// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments); /// // Specific alignment -/// IntegerLiteral *Ex2 = new (Context, 8) IntegerLiteral(arguments); +/// IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments); /// @endcode /// Please note that you cannot use delete on the pointer; it must be /// deallocated using an explicit destructor call followed by @@ -1351,10 +1351,10 @@ inline void operator delete(void *Ptr, clang::ASTContext &C, size_t) /// null on error. /// Usage looks like this (assuming there's an ASTContext 'Context' in scope): /// @code -/// // Default alignment (16) +/// // Default alignment (8) /// char *data = new (Context) char[10]; /// // Specific alignment -/// char *data = new (Context, 8) char[10]; +/// char *data = new (Context, 4) char[10]; /// @endcode /// Please note that you cannot use delete on the pointer; it must be /// deallocated using an explicit destructor call followed by @@ -1366,7 +1366,7 @@ inline void operator delete(void *Ptr, clang::ASTContext &C, size_t) /// allocator supports it). /// @return The allocated memory. Could be NULL. inline void *operator new[](size_t Bytes, clang::ASTContext& C, - size_t Alignment = 16) throw () { + size_t Alignment = 8) throw () { return C.Allocate(Bytes, Alignment); } diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 94caa6faad6..466848976cb 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -126,12 +126,12 @@ public: // Only allow allocation of Stmts using the allocator in ASTContext // or by doing a placement new. void* operator new(size_t bytes, ASTContext& C, - unsigned alignment = 16) throw() { + unsigned alignment = 8) throw() { return ::operator new(bytes, C, alignment); } void* operator new(size_t bytes, ASTContext* C, - unsigned alignment = 16) throw() { + unsigned alignment = 8) throw() { return ::operator new(bytes, *C, alignment); } |