Lines Matching refs:malloc
762 #define SQLITE_NOMEM 7 /* A malloc() failed */
2033 ** malloc(), realloc() and free() functions from the standard C library.
2228 ** to using its default memory allocator (the system malloc() implementation),
3247 ** Windows VFS uses native malloc() and free() for some operations.
4874 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
8776 ** <dd>This parameter returns the number of malloc attempts that were
8782 ** <dd>This parameter returns the number malloc attempts that might have
8790 ** <dd>This parameter returns the number malloc attempts that might have
13646 ** SQLITE_SYSTEM_MALLOC // Use normal system malloc()
13649 ** SQLITE_MEMDEBUG // Debugging version of system malloc()
13815 ** Some malloc failures are only possible if SQLITE_TEST_REALLOC_STRESS is
14547 ** underlying malloc() implementation might return us 4-byte aligned
16857 ** Lookaside malloc is a set of fixed-size buffers that can be used
16860 ** lookaside malloc provides a significant performance enhancement
16861 ** (approx 10%) by avoiding numerous malloc/free requests while parsing
16865 ** lookaside malloc subsystem. Each available memory allocation in
17031 u8 mallocFailed; /* True if we have seen a malloc failure */
17101 Lookaside lookaside; /* Lookaside malloc configuration */
18400 #define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */
19415 u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
19502 int isMallocInit; /* True after malloc is initialized */
19503 int isPCacheInit; /* True after malloc is initialized */
19901 ** obtain space from malloc().
20835 ** malloc failures. This is only present if SQLITE_UNTESTABLE
24907 ** So we test the effects of a malloc() failing and the sqlite3OsXXX()
24910 ** The following functions are instrumented for malloc() failure
25205 ** ability to simulate a malloc failure, so that the handling of an
25327 ** malloc failures (when the xMalloc() or xRealloc() method of the
25331 ** Most malloc failures are non-benign. After they occur, SQLite
25334 ** fatal. For example, if a malloc fails while resizing a hash table, this
25336 ** hash table will continue to function normally. So a malloc failure
25384 ** subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
25385 ** indicates that subsequent malloc failures are non-benign.
25479 ** SQLite will use the standard C-library malloc/realloc/free interface
25524 #include <malloc/malloc.h>
25538 ** Use standard C library malloc and free on non-Apple systems.
25541 #define SQLITE_MALLOC(x) malloc(x)
25546 ** The malloc.h header file is needed for malloc_usable_size() function
25556 ** the malloc.h header file.
25564 ** Include the malloc.h header file, if necessary. Also set define macro
25571 # include <malloc.h>
25586 ** Like malloc(), but remember the size of the allocation
25715 /* defer MT decisions to system malloc */
25773 ** SQLite will use the standard C-library malloc/realloc/free interface
25831 ** Number of malloc size increments to track.
25951 /* If memory status is enabled, then the malloc.c wrapper will already
26014 p = malloc(totalSize);
26306 ** use of malloc(). The SQLite user supplies a block of memory
26509 ** will already be held (obtained by code in malloc.c) if
26791 assert( nBytes>0 ); /* malloc.c filters out 0 byte requests */
26996 ** use of malloc(). The application gives SQLite a block of memory
27089 u64 nAlloc; /* Total number of calls to malloc */
27090 u64 totalAlloc; /* Total of all malloc calls - includes internal frag */
29041 /************** Begin file malloc.c ******************************************/
29662 ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
29664 ** Hence for a particular database connection, once malloc starts
29673 ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
29919 ** function. However, if a malloc() failure has occurred since the previous
29938 /************** End of malloc.c **********************************************/
30191 ** malloc(). This precondition is required by the mprintf("%z...")
34953 ** binary value has been obtained from malloc and must be freed by
35250 sqlite3 *db, /* The database connection used for malloc() */
35548 ** The key is not copied in this instance. If a malloc fails, then
42600 ** (b) A malloc failed.
42604 ** descriptors on this file, then no malloc would be required by
49742 ** obtained from malloc and must be freed by the calling function.
49762 ** is obtained from malloc and must be freed by the calling
52308 ** malloc fails.
52521 ** on both a Bitvec object and on a linear array of bits obtained from malloc.
57152 ** Use a testcase() macro to make sure that malloc failure within
57294 ** or SQLITE_NOMEM if a malloc failure occurs.
57662 ** malloc error occurs during a rollback, then this will itself cause
57865 ** not be in the pager cache. Later: if a malloc() or IO error occurs
58039 ** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors
58299 ** If an I/O or malloc() error occurs, the journal-file is not deleted
58466 ** malloc error that occurred after the change-counter was updated but
60045 ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
61121 ** to test the case where a malloc error occurs while trying to set
62431 ** malloc failure occurs while populating it in the for(...) loop below.
62660 ** page content. If a malloc fails, this function may return NULL.
62804 ** to a malloc() or IO failure), clear the bit in the pInJournal[]
63133 ** (e.g. due to malloc() failure), return an error code.
68154 ** An unrecoverable error (an I/O error or a malloc failure) has occurred
68976 ** is returned if a malloc attempt fails.
79294 ** malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is
80744 ** SQLITE_NOMEM may be returned if a malloc() fails during conversion
80885 ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
81792 ** If this routine fails for any reason (malloc returns NULL or unable
83286 /* Return true if hasAbort==mayAbort. Or if a malloc failure occurred.
83287 ** If malloc failed, then the while() loop above may not have iterated
83525 ** having to malloc for more space (except when compiled using
84796 /* This happens if a malloc() inside a call to sqlite3_column_text() or
87061 ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
89084 ** select list of a SELECT statement) that may cause a malloc() failure. If
89085 ** malloc() has failed, the threads mallocFailed flag is cleared and the result
89101 /* If malloc() failed during an encoding conversion within an
89123 ** need to call malloc() to expand the result of a zeroblob()
89230 /* A malloc may have failed inside of the _text() call. If this
90528 ** minimizes the number of malloc calls made by the system.
91081 /* This happens if a malloc() inside a call to sqlite3_column_text() or
99238 /* Jump to here if a malloc() fails.
100705 sqlite3 *db, /* Database connection (for malloc()) */
101078 ** set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
106891 sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */
107231 u32 staticFlag; /* EP_Static if space not obtained from malloc */
112028 ** the new element. Return a negative number if malloc fails.
112044 ** the new element. Return a negative number if malloc fails.
114888 sqlite3 *db; /* Database connection, for malloc() */
118278 ** If malloc has already failed, it may be that it failed while allocating
120526 sqlite3 *db = pParse->db; /* Database connection for malloc errors */
122113 sqlite3 *db, /* Connection to notify of malloc failures */
122140 ** A new IdList is returned, or NULL if malloc() fails.
123284 /* If a malloc() failure occurred in sqlite3HashInsert(), it will
125159 ** the database handle that malloc() has failed and return NULL.
131786 ** malloc() and make *pzErrMsg point to that message.
132038 void *(*malloc)(int);
132390 #define sqlite3_malloc sqlite3_api->malloc
137747 ** cost for this mechansim (an extra malloc), so it should not be used
139784 ** Space to hold the KeyInfo structure is obtained from malloc. The calling
140733 ** Space to hold the KeyInfo structure is obtained from malloc. The calling
143293 Parse *pParse, /* Parse context (for malloc() and error reporting) */
146269 ** malloc() for space to hold the result and return the entire results
146273 ** from malloc(). But the caller cannot free this memory directly.
150663 ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
151062 sqlite3 *db, /* Database connection for reporting malloc problems */
155216 sqlite3 *db; /* Database connection (for malloc) */
155773 assert( pExpr!=0 ); /* Because malloc() has not failed */
159342 sqlite3 *db = pParse->db; /* Database connection malloc context */
162752 /* Jump here if malloc fails */
166289 ** Alternative datatype for the argument to the malloc() routine passed
168475 pNew = malloc(newSize*sizeof(pNew[0]));
168536 ** malloc.
173647 /* Initialize the malloc() system and the recursive pInitMutex mutex.
173650 ** malloc subsystem - this implies that the allocation of a static
173651 ** mutex must not require support from the malloc subsystem.
173674 /* If rc is not SQLITE_OK at this point, then either the malloc
173996 ** (the system malloc() implementation), undoing any prior invocation of
173999 ** Setting sqlite3GlobalConfig.m to all zeros will cause malloc to
175240 ** that if a malloc() fails in sqlite3_create_function(), an error code
176074 /* A malloc() may have failed within the call to sqlite3_value_text16()
176088 ** passed to this function, we assume a malloc() failed during sqlite3_open().
176806 ** conversions. The only error that can occur here is a malloc() failure.
176945 /* Enable the lookaside-malloc subsystem */
177158 ** malloc() failure, but SQLite now does this automatically.
177548 ** Register hooks to call to indicate which malloc() failures
178095 ** passing free() a pointer that was not obtained from malloc() - it is
178599 void *aStatic[16]; /* Starter space for aArg[]. No malloc required */
179557 ** malloc overhead. When nPendingData exceeds nMaxPendingData, all hash
186709 ** if a malloc failure occurs, or SQLITE_ERROR if a parse error is encountered.
187934 ** The key is not copied in this instance. If a malloc fails, then
190078 int nMalloc; /* Size of malloc'd buffer at zMalloc */
190082 char *aData; /* Pointer to block from malloc() */
190111 int nMalloc; /* Size of malloc'd buffer at zMalloc */
191087 char **paBlob, /* OUT: Blob data in malloc'd buffer */
196247 ** the required space using malloc().
202437 ** NULL if malloc fails.
210485 ** As well as the returned string, three other malloc'd strings are
219635 ** of SQLite. If a malloc fails in an sqlite3_value_xxx() function, either
222853 ** Alternative datatype for the argument to the malloc() routine passed
223275 pNew = malloc(newSize*sizeof(pNew[0]));
223336 ** malloc.
225827 char **pzOut, /* OUT: malloc'd buffer containing str/bw */
245523 unsigned char *output = (unsigned char *)malloc(ctx->codecConst.hmacSize);