mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user