Lines Matching refs:malloc
390 ** SQLITE_SYSTEM_MALLOC // Use normal system malloc()
392 ** SQLITE_MEMDEBUG // Debugging version of system malloc()
939 #define SQLITE_NOMEM 7 /* A malloc() failed */
1831 ** malloc(), realloc() and free() functions from the standard C library.
2012 ** to using its default memory allocator (the system malloc() implementation),
2674 ** Windows VFS uses native malloc() and free() for some operations.
2722 ** the system malloc() and free() directly when converting
3732 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
6507 ** <dd>This parameter returns the number malloc attempts that were
6513 ** <dd>This parameter returns the number malloc attempts that might have
6521 ** <dd>This parameter returns the number malloc attempts that might have
8016 ** underlying malloc() implemention might return us 4-byte aligned
9666 ** Lookaside malloc is a set of fixed-size buffers that can be used
9669 ** lookaside malloc provides a significant performance enhancement
9670 ** (approx 10%) by avoiding numerous malloc/free requests while parsing
9674 ** lookaside malloc subsystem. Each available memory allocation in
9727 u8 mallocFailed; /* True if we have seen a malloc failure */
9773 Lookaside lookaside; /* Lookaside malloc configuration */
10607 #define EP_Static 0x8000 /* Held in memory not obtained from malloc() */
11309 char *zBase; /* A base allocation. Not from malloc. */
11362 int isMallocInit; /* True after malloc is initialized */
11363 int isPCacheInit; /* True after malloc is initialized */
11497 ** obtain space from malloc().
12072 ** malloc failures. This is only present if SQLITE_OMIT_BUILTIN_TEST
13115 ** malloc failure when SQLite is invoked recursively by a virtual table
14692 ** So we test the effects of a malloc() failing and the sqlite3OsXXX()
14695 ** The following functions are instrumented for malloc() failure
14926 ** ability to simulate a malloc failure, so that the handling of an
15041 ** malloc failures (when the xMalloc() or xRealloc() method of the
15045 ** Most malloc failures are non-benign. After they occur, SQLite
15048 ** fatal. For example, if a malloc fails while resizing a hash table, this
15050 ** hash table will continue to function normally. So a malloc failure
15097 ** subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
15098 ** indicates that subsequent malloc failures are non-benign.
15191 ** SQLite will use the standard C-library malloc/realloc/free interface
15245 #include <malloc/malloc.h>
15257 ** Use standard C library malloc and free on non-Apple systems.
15260 #define SQLITE_MALLOC(x) malloc(x)
15266 # include <malloc.h> /* Needed for malloc_usable_size on linux */
15279 ** Like malloc(), but remember the size of the allocation
15405 /* defer MT decisions to system malloc */
15472 ** SQLite will use the standard C-library malloc/realloc/free interface
15529 ** Number of malloc size increments to track.
15649 /* If memory status is enabled, then the malloc.c wrapper will already
15712 p = malloc(totalSize);
16004 ** use of malloc(). The SQLite user supplies a block of memory
16206 ** will already be held (obtained by code in malloc.c) if
16488 assert( nBytes>0 ); /* malloc.c filters out 0 byte requests */
16693 ** use of malloc(). The application gives SQLite a block of memory
16784 u64 nAlloc; /* Total number of calls to malloc */
16785 u64 totalAlloc; /* Total of all malloc calls - includes internal frag */
16863 ** will already be held (obtained by code in malloc.c) if
18586 /************** Begin file malloc.c ******************************************/
19182 ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
19184 ** Hence for a particular database connection, once malloc starts
19193 ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
19344 ** function. However, if a malloc() failure has occurred since the previous
19347 ** If the first argument, db, is not NULL and a malloc() error has occurred,
19365 /************** End of malloc.c **********************************************/
20947 ** If a malloc failure occurs, NULL is returned and the db.mallocFailed
22057 ** binary value has been obtained from malloc and must be freed by
22459 ** The key is not copied in this instance. If a malloc fails, then
22696 ** This driver uses malloc()/free() directly rather than going through
22699 ** malloc failures happen frequently. OS/2 does not typically run on
22705 ** wrappers then we will get simulated malloc() failures within this
22707 ** could enhance SQLite to deal with simulated malloc failures within
22709 ** be exercised on Linux (which does not need to malloc() in the driver)
22715 ** avoid the use of malloc()/free(). Those routines work ok on OS/2
29713 ** (b) A malloc failed.
29717 ** descriptors on this file, then no malloc would be required by
33052 ** Space to hold the returned string is obtained from malloc.
35044 ** is obtained from malloc and must be freed by the calling
35952 ** malloc fails.
36162 ** on both a Bitvec object and on a linear array of bits obtained from malloc.
36999 void *pStart, *pEnd; /* Bounds of pagecache malloc range */
37057 ** Malloc function used within this file to allocate space from the buffer
37203 ** Malloc function used by SQLite to obtain space from the buffer configured
39996 ** Use a testcase() macro to make sure that malloc failure within
40145 ** or SQLITE_NOMEM if a malloc failure occurs.
40450 ** malloc error occurs during a rollback, then this will itself cause
40635 ** not be in the pager cache. Later: if a malloc() or IO error occurs
40807 ** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors
40818 sqlite3_file *pMaster; /* Malloc'd master-journal file descriptor */
40819 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
41050 ** If an I/O or malloc() error occurs, the journal-file is not deleted
41209 ** malloc error that occurred after the change-counter was updated but
42569 ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
43512 ** to test the case where a malloc error occurs while trying to set
44620 ** malloc failure occurs while populating it in the for(...) loop below.
44924 ** to a malloc() or IO failure), clear the bit in the pInJournal[]
45225 ** (e.g. due to malloc() failure), return an error code.
45348 ** page content. If a malloc fails, this function may return NULL.
46454 u8 *aFrame = 0; /* Malloc'd buffer to load entire frame */
46507 /* Malloc a buffer to read frames into. */
49002 ** A unrecoverable error (an I/O error or a malloc failure) has occurred
49684 ** is returned if a malloc attempt fails.
49971 ** table, then malloc space for and store the pCur->nKey bytes of key
50048 char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */
57311 ** malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is
58413 ** SQLITE_NOMEM may be returned if a malloc() fails during conversion
58494 ** malloc(). In this way, we know that the memory is safe to be
58497 ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
59275 ** If this routine fails for any reason (malloc returns NULL or unable
59778 ** Zero is returned if a malloc() fails.
59926 /* Return true if hasAbort==mayAbort. Or if a malloc failure occured.
59927 ** If malloc failed, then the while() loop above may not have iterated
60696 /* This happens if a malloc() inside a call to sqlite3_column_text() or
63149 /* Check that malloc() has not failed. If it has, return early. */
63508 ** select list of a SELECT statement) that may cause a malloc() failure. If
63509 ** malloc() has failed, the threads mallocFailed flag is cleared and the result
63525 /* If malloc() failed during an encoding conversion within an
63545 ** need to call malloc() to expand the result of a zeroblob()
63644 /* A malloc may have failed inside of the xFunc() call. If this
64495 ** already. Return non-zero if a malloc() fails.
64570 ** minimizes the number of malloc calls made by the system.
65451 /* This happens if a malloc() inside a call to sqlite3_column_text() or
66329 /* Even though a malloc() has failed, the implementation of the
71172 /* Jump to here if a malloc() fails.
72121 ** set *ppFile to point to the malloc'd file-handle and return SQLITE_OK.
74948 sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */
75446 /* Avoid leaking memory if malloc has failed. */
78199 ** the new element. Return a negative number if malloc fails.
78215 ** the new element. Return a negative number if malloc fails.
81475 return; /* A malloc must have failed */
82868 assert( p==pOld ); /* Malloc must have failed inside HashInsert() */
82977 sqlite3 *db = pParse->db; /* Database connection for malloc errors */
84057 assert( p==pIndex ); /* Malloc must have failed */
84290 sqlite3 *db, /* Connection to notify of malloc failures */
84318 ** A new IdList is returned, or NULL if malloc() fails.
84469 sqlite3 *db, /* Connection to notify of malloc failures */
85220 /* If a malloc() failure occurred in sqlite3HashInsert(), it will
86465 ** the database handle that malloc() has failed and return NULL.
90865 ** malloc() and make *pzErrMsg point to that message.
91122 void *(*malloc)(int);
91337 #define sqlite3_malloc sqlite3_api->malloc
92547 /* Malloc may fail when setting the page-size, as there is an internal
95290 ** Space to hold the KeyInfo structure is obtain from malloc. The calling
97062 sqlite3 *db, /* Report malloc errors to this connection */
97094 sqlite3 *db, /* Report malloc errors here */
97106 sqlite3 *db, /* Report malloc errors here */
99261 ** malloc() for space to hold the result and return the entire results
99265 ** from malloc(). But the caller cannot free this memory directly.
101905 assert( pTab==pOld ); /* Malloc must have failed inside HashInsert() */
102082 ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
102431 sqlite3 *db, /* Database connection for reporting malloc problems */
104898 ** malloc in allocateIndexInfo() fails and this function returns leaving
107689 /* Jump here if malloc fails */
109173 ** malloc.
109334 ** from malloc.
112609 /* Initialize the malloc() system and the recursive pInitMutex mutex.
112612 ** malloc subsystem - this implies that the allocation of a static
112613 ** mutex must not require support from the malloc subsystem.
112636 /* If rc is not SQLITE_OK at this point, then either the malloc
112813 /* Specify an alternative malloc implementation */
112818 /* Retrieve the current malloc() implementation */
112824 /* Enable or disable the malloc status collection */
112881 /* If the heap pointer is NULL, then restore the malloc implementation
112882 ** back to NULL pointers too. This will cause the malloc to go
113545 ** that if a malloc() fails in sqlite3_create_function(), an error code
114105 /* A malloc() may have failed within the call to sqlite3_value_text16()
114119 ** passed to this function, we assume a malloc() failed during sqlite3_open().
114670 ** conversions. The only error that can occur here is a malloc() failure.
114785 /* Enable the lookaside-malloc subsystem */
114970 ** malloc() failure, but SQLite now does this automatically.
115261 ** Register hooks to call to indicate which malloc() failures
115758 void *aStatic[16]; /* Starter space for aArg[]. No malloc required */
116649 ** malloc overhead. When nPendingData exceeds nMaxPendingData, the buffer
117643 const char ***pazCol, /* OUT: Malloc'd array of column names */
118833 char *aaOutput[16]; /* Malloc'd output buffers */
118934 char **paOut, int *pnOut /* OUT: Malloc'd doclist */
122715 ** if a malloc failure occurs, or SQLITE_ERROR if a parse error is encountered.
123382 ** Malloc and Free functions
123665 ** The key is not copied in this instance. If a malloc fails, then
125267 int nMalloc; /* Size of malloc'd buffer at zMalloc */
125268 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
125271 char *aData; /* Pointer to block from malloc() */
125299 int nMalloc; /* Size of malloc'd buffer at zMalloc */
125300 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
125766 /* Malloc failed while inserting the new entry. This can only
126184 char **paBlob, /* OUT: Blob data in malloc'd buffer */
129081 ** the required space using malloc().