SQLite

Check-in [f623d6e74f]
Login

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

Overview
Comment:Rearrange memory allocation in sqlite3VdbeMakeReady to try to work around some byte-alignment problems on Sparc. (CVS 2002)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f623d6e74fb5f6f70a22c06278b2bb1b4b7f9b85
User & Date: drh 2004-10-05 17:37:36.000
Context
2004-10-06
14:39
Fix the ".import" command of the command-line shell so that it ignores \n and \r at the end of a line. Ticket #939. (CVS 2003) (check-in: dcbf4817a7 user: drh tags: trunk)
2004-10-05
17:37
Rearrange memory allocation in sqlite3VdbeMakeReady to try to work around some byte-alignment problems on Sparc. (CVS 2002) (check-in: f623d6e74f user: drh tags: trunk)
15:42
Use the database name supplied to table_info() and related pragmas. (CVS 2001) (check-in: 0415af3257 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeaux.c.
600
601
602
603
604
605
606
607

608
609
610
611
612
613
614

615
616
617
618
619
620
621
622
623
624
625
626
627
628
  ** Allocation all the stack space we will ever need.
  */
  if( p->aStack==0 ){
    resolveP2Values(p);
    assert( nVar>=0 );
    n = isExplain ? 10 : p->nOp;
    p->aStack = sqliteMalloc(
      n*(sizeof(p->aStack[0])+sizeof(Mem*))          /* aStack, apArg */

      + nVar*sizeof(Mem)                             /* aVar */
      + nVar*sizeof(char*)                           /* azVar */
      + nMem*sizeof(Mem)                             /* aMem */
      + nCursor*sizeof(Cursor*)                      /* apCsr */
    );
    if( !sqlite3_malloc_failed ){
      p->apArg = (Mem **)&p->aStack[n];

      p->aVar = (Mem *)&p->apArg[n];
      p->azVar = (char**)&p->aVar[nVar];
      p->okVar = 0;
      p->nVar = nVar;
      p->aMem = (Mem*)&p->azVar[nVar];
      p->nMem = nMem;
      p->apCsr = (Cursor**)&p->aMem[nMem];
      p->nCursor = nCursor;
      for(n=0; n<nVar; n++){
        p->aVar[n].flags = MEM_Null;
      }
      for(n=0; n<nMem; n++){
        p->aMem[n].flags = MEM_Null;
      }







|
>
|
|
|
|


|
>
|
|

<
|
|
|







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619

620
621
622
623
624
625
626
627
628
629
  ** Allocation all the stack space we will ever need.
  */
  if( p->aStack==0 ){
    resolveP2Values(p);
    assert( nVar>=0 );
    n = isExplain ? 10 : p->nOp;
    p->aStack = sqliteMalloc(
        n*sizeof(p->aStack[0])         /* aStack */
      + n*sizeof(Mem*)                 /* apArg */
      + nVar*sizeof(Mem)               /* aVar */
      + nVar*sizeof(char*)             /* azVar */
      + nMem*sizeof(Mem)               /* aMem */
      + nCursor*sizeof(Cursor*)        /* apCsr */
    );
    if( !sqlite3_malloc_failed ){
      p->aMem = &p->aStack[n];
      p->nMem = nMem;
      p->aVar = &p->aMem[nMem];
      p->nVar = nVar;
      p->okVar = 0;

      p->apArg = (Mem**)&p->aVar[nVar];
      p->azVar = (char**)&p->apArg[n];
      p->apCsr = (Cursor**)&p->azVar[nVar];
      p->nCursor = nCursor;
      for(n=0; n<nVar; n++){
        p->aVar[n].flags = MEM_Null;
      }
      for(n=0; n<nMem; n++){
        p->aMem[n].flags = MEM_Null;
      }