Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Correctly handle malloc() failure in GenericMalloc() and GenericRealloc(). Fix for #1617. (CVS 2958) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9dfc4a880b49869e945d6a19e63fcf6d |
User & Date: | danielk1977 2006-01-16 14:29:06.000 |
Context
2006-01-16
| ||
15:14 | Fix some of the issues raised in #1615. (CVS 2959) (check-in: 0d5d83bcbd user: danielk1977 tags: trunk) | |
14:29 | Correctly handle malloc() failure in GenericMalloc() and GenericRealloc(). Fix for #1617. (CVS 2958) (check-in: 9dfc4a880b user: danielk1977 tags: trunk) | |
12:46 | Run the tests in shared.test a second time using an autovacuum database. (CVS 2957) (check-in: 9927522923 user: danielk1977 tags: trunk) | |
Changes
Changes to src/os_common.h.
︙ | ︙ | |||
144 145 146 147 148 149 150 151 | #if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG) void *sqlite3GenericMalloc(int n){ char *p = (char *)malloc(n+8); assert(n>0); assert(sizeof(int)<=8); if( p ){ *(int *)p = n; } | > | > | | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | #if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG) void *sqlite3GenericMalloc(int n){ char *p = (char *)malloc(n+8); assert(n>0); assert(sizeof(int)<=8); if( p ){ *(int *)p = n; p += 8; } return (void *)p; } void *sqlite3GenericRealloc(void *p, int n){ char *p2 = ((char *)p - 8); assert(n>0); p2 = realloc(p2, n+8); if( p2 ){ *(int *)p2 = n; p2 += 8; } return (void *)p2; } void sqlite3GenericFree(void *p){ assert(p); free((void *)((char *)p - 8)); } int sqlite3GenericAllocationSize(void *p){ return p ? *(int *)((char *)p - 8) : 0; |
︙ | ︙ |