diff options
author | drh <drh@noemail.net> | 2010-09-11 15:54:53 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-09-11 15:54:53 +0000 |
commit | 1567acf96ac2eb84d65e122168dc749fad4b028d (patch) | |
tree | 36aaa6cea97b7beaf5ba83c48ad0c6aee9e4c593 /src | |
parent | d9e430e95339d215cf38042e045864bc15c4aa79 (diff) | |
download | sqlite-1567acf96ac2eb84d65e122168dc749fad4b028d.tar.gz sqlite-1567acf96ac2eb84d65e122168dc749fad4b028d.zip |
Add assert() statements to demonstrate that memory allocations are always
aligned to an 8-byte boundary (unless SQLITE_4_BYTE_ALIGNED_MALLOC is defined).
FossilOrigin-Name: 305cc4e6c1164b1ede0c3177e3c0f9b8644df0f6
Diffstat (limited to 'src')
-rw-r--r-- | src/malloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/malloc.c b/src/malloc.c index 85ba9468c..948eb91d1 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -307,6 +307,7 @@ void *sqlite3Malloc(int n){ }else{ p = sqlite3GlobalConfig.m.xMalloc(n); } + assert( EIGHT_BYTE_ALIGNMENT(p) ); /* IMP: R-36023-12588 */ return p; } @@ -544,6 +545,7 @@ void *sqlite3Realloc(void *pOld, int nBytes){ }else{ pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); } + assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-36023-12588 */ return pNew; } |