/ Check-in [b98a8706]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Always call sqlite3_malloc() in sqlite3OsInit(), even when not compiled with SQLITE_TEST.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b98a8706a61ad27c881b6820eee10d06bfb27417
User & Date: drh 2009-08-17 16:01:11
Context
2009-08-18
01:54
Fix a bug in mem5.c which would cause an infinite loop on an attempt to allocate more than 1073741824 bytes of contiguous memory. Also, some cleanup of mem5.c. More work to do on this. check-in: 783b751a user: drh tags: trunk
2009-08-17
16:01
Always call sqlite3_malloc() in sqlite3OsInit(), even when not compiled with SQLITE_TEST. check-in: b98a8706 user: drh tags: trunk
15:52
Move error simulation code from the sqlite3_os_init() functions into a wrapper. check-in: 67ad21ab user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os.c.

193
194
195
196
197
198
199
200


201
202
203
204
205
206
207
/*
** This function is a wrapper around the OS specific implementation of
** sqlite3_os_init(). The purpose of the wrapper is to provide the
** ability to simulate a malloc failure, so that the handling of an
** error in sqlite3_os_init() by the upper layers can be tested.
*/
int sqlite3OsInit(void){
  DO_OS_MALLOC_TEST(0);


  return sqlite3_os_init();
}

/*
** The list of all registered VFS implementations.
*/
static sqlite3_vfs * SQLITE_WSD vfsList = 0;







|
>
>







193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
** This function is a wrapper around the OS specific implementation of
** sqlite3_os_init(). The purpose of the wrapper is to provide the
** ability to simulate a malloc failure, so that the handling of an
** error in sqlite3_os_init() by the upper layers can be tested.
*/
int sqlite3OsInit(void){
  void *p = sqlite3_malloc(10);
  if( p==0 ) return SQLITE_NOMEM;
  sqlite3_free(p);
  return sqlite3_os_init();
}

/*
** The list of all registered VFS implementations.
*/
static sqlite3_vfs * SQLITE_WSD vfsList = 0;