1
0
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:
drh
2010-09-11 15:54:53 +00:00
parent d9e430e953
commit 1567acf96a
3 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
C When\sbuilding\sfrom\sthe\samalgamation\swith\sENABLE_RTREE\sdefined,\sdo\snot\stry\sto\sinclude\ssqlite3rtree.h.
D 2010-09-11T05:15:38
C Add\sassert()\sstatements\sto\sdemonstrate\sthat\smemory\sallocations\sare\salways\naligned\sto\san\s8-byte\sboundary\s(unless\sSQLITE_4_BYTE_ALIGNED_MALLOC\sis\sdefined).
D 2010-09-11T15:54:53
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -140,7 +140,7 @@ F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
F src/loadext.c 6d422ea91cf3d2d00408c5a8f2391cd458da85f8
F src/main.c da74b2269470d97a702d2956eeeb691a5e3a68c3
F src/malloc.c e0e9ca16a90215e2f0b53e7f5cc17abe01fbe34a
F src/malloc.c ab48f49442aa78c8c7019845c634ac05b07e59dc
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
F src/mem2.c e307323e86b5da1853d7111b68fd6b84ad6f09cf
@@ -857,7 +857,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P c65583dbc7203132010d223cce205f007a50c9ee
R 6d86dfe87f6f388a64cf2ae7ca4571d4
U dan
Z 085aaafc3fe0100f3118b285035f1c7a
P 5b63e981f1bef26eae0da3144a08bdc54dc36709
R 5f696ac739736af24121b122c94485c1
U drh
Z 6c746302b511dbe67ce0549fd9634e5e

View File

@@ -1 +1 @@
5b63e981f1bef26eae0da3144a08bdc54dc36709
305cc4e6c1164b1ede0c3177e3c0f9b8644df0f6

View File

@@ -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;
}