Changeset 846 for trunk/src/3rdparty/sqlite/sqlite3.c
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/sqlite/sqlite3.c
r595 r846 48453 48453 48454 48454 /* 48455 ** Allocate space from a fixed size buffer. Make *pp point to the 48456 ** allocated space. (Note: pp is a char* rather than a void** to 48457 ** work around the pointer aliasing rules of C.) *pp should initially 48458 ** be zero. If *pp is not zero, that means that the space has already 48459 ** been allocated and this routine is a noop. 48455 ** Allocate space from a fixed size buffer and return a pointer to 48456 ** that space. If insufficient space is available, return NULL. 48457 ** 48458 ** The pBuf parameter is the initial value of a pointer which will 48459 ** receive the new memory. pBuf is normally NULL. If pBuf is not 48460 ** NULL, it means that memory space has already been allocated and that 48461 ** this routine should not allocate any new memory. When pBuf is not 48462 ** NULL simply return pBuf. Only allocate new memory space when pBuf 48463 ** is NULL. 48460 48464 ** 48461 48465 ** nByte is the number of bytes of space needed. … … 48468 48472 ** request, then increment *pnByte by the amount of the request. 48469 48473 */ 48470 static void allocSpace(48471 char *pp, /* IN/OUT: Set *pp to point to allocated buffer*/48474 static void allocSpace( 48475 */ 48472 48476 int nByte, /* Number of bytes to allocate */ 48473 48477 u8 **ppFrom, /* IN/OUT: Allocate from *ppFrom */ … … 48476 48480 ){ 48477 48481 assert( EIGHT_BYTE_ALIGNMENT(*ppFrom) ); 48478 if( (*(void**)pp)==0 ){48479 48480 48481 *(void**)pp = (void*)*ppFrom;48482 48483 48484 48485 48486 }48482 if( 48483 nByte = ROUND8(nByte); 48484 if( &(*ppFrom)[nByte] <= pEnd ){ 48485 *)*ppFrom; 48486 *ppFrom += nByte; 48487 }else{ 48488 *pnByte += nByte; 48489 } 48490 48487 48491 } 48488 48492 … … 48557 48561 do { 48558 48562 nByte = 0; 48559 allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte); 48560 allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte); 48561 allocSpace((char*)&p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte); 48562 allocSpace((char*)&p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte); 48563 allocSpace((char*)&p->apCsr, 48564 nCursor*sizeof(VdbeCursor*), &zCsr, zEnd, &nByte 48565 ); 48563 p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte); 48564 p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte); 48565 p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte); 48566 p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte); 48567 p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*), 48568 &zCsr, zEnd, &nByte); 48566 48569 if( nByte ){ 48567 48570 p->pFree = sqlite3DbMallocZero(db, nByte);
Note:
See TracChangeset
for help on using the changeset viewer.