Fossil SCM
fileedit: removed a call to blob_reserve() (optimization) because we have a report which seems to imply that it unconditionally fails on mingw 32-bit builds.
Commit
b99c069a2c7004f442683a407884eb0b1270a3976733b611a755d349c7c2a9cd
Parent
0d6ed8c0b66549a…
2 files changed
+5
-4
+5
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -487,10 +487,15 @@ | ||
| 487 | 487 | ** |
| 488 | 488 | ** For semantic compatibility with blob_append_full(), if newSize is |
| 489 | 489 | ** >=0x7fff000 (~2GB) then this function will trigger blob_panic(). If |
| 490 | 490 | ** it didn't, it would be possible to bypass that hard-coded limit via |
| 491 | 491 | ** this function. |
| 492 | +** | |
| 493 | +** We've had at least one report: | |
| 494 | +** https://fossil-scm.org/forum/forumpost/b7bbd28db4 | |
| 495 | +** which implies that this is unconditionally failing on mingw 32-bit | |
| 496 | +** builds. | |
| 492 | 497 | */ |
| 493 | 498 | void blob_reserve(Blob *pBlob, unsigned int newSize){ |
| 494 | 499 | if(newSize>=0x7fff0000 ){ |
| 495 | 500 | blob_panic(); |
| 496 | 501 | }else if(newSize>pBlob->nUsed){ |
| 497 | 502 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -487,10 +487,15 @@ | |
| 487 | ** |
| 488 | ** For semantic compatibility with blob_append_full(), if newSize is |
| 489 | ** >=0x7fff000 (~2GB) then this function will trigger blob_panic(). If |
| 490 | ** it didn't, it would be possible to bypass that hard-coded limit via |
| 491 | ** this function. |
| 492 | */ |
| 493 | void blob_reserve(Blob *pBlob, unsigned int newSize){ |
| 494 | if(newSize>=0x7fff0000 ){ |
| 495 | blob_panic(); |
| 496 | }else if(newSize>pBlob->nUsed){ |
| 497 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -487,10 +487,15 @@ | |
| 487 | ** |
| 488 | ** For semantic compatibility with blob_append_full(), if newSize is |
| 489 | ** >=0x7fff000 (~2GB) then this function will trigger blob_panic(). If |
| 490 | ** it didn't, it would be possible to bypass that hard-coded limit via |
| 491 | ** this function. |
| 492 | ** |
| 493 | ** We've had at least one report: |
| 494 | ** https://fossil-scm.org/forum/forumpost/b7bbd28db4 |
| 495 | ** which implies that this is unconditionally failing on mingw 32-bit |
| 496 | ** builds. |
| 497 | */ |
| 498 | void blob_reserve(Blob *pBlob, unsigned int newSize){ |
| 499 | if(newSize>=0x7fff0000 ){ |
| 500 | blob_panic(); |
| 501 | }else if(newSize>pBlob->nUsed){ |
| 502 |
-4
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -364,14 +364,10 @@ | ||
| 364 | 364 | blob_appendf(pOut, "B %s\n", |
| 365 | 365 | pCI->pParent->zBaseline |
| 366 | 366 | ? pCI->pParent->zBaseline |
| 367 | 367 | : pCI->zParentUuid); |
| 368 | 368 | } |
| 369 | - blob_reserve(pOut, 1024 * | |
| 370 | - (asDelta ? 2 : pCI->pParent->nFile/11+1 | |
| 371 | - /* In the fossil core repo, each 12-ish F-cards (on | |
| 372 | - ** average) take up roughly 1kb */)); | |
| 373 | 369 | if(blob_size(&pCI->comment)!=0){ |
| 374 | 370 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 375 | 371 | }else{ |
| 376 | 372 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 377 | 373 | } |
| 378 | 374 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -364,14 +364,10 @@ | |
| 364 | blob_appendf(pOut, "B %s\n", |
| 365 | pCI->pParent->zBaseline |
| 366 | ? pCI->pParent->zBaseline |
| 367 | : pCI->zParentUuid); |
| 368 | } |
| 369 | blob_reserve(pOut, 1024 * |
| 370 | (asDelta ? 2 : pCI->pParent->nFile/11+1 |
| 371 | /* In the fossil core repo, each 12-ish F-cards (on |
| 372 | ** average) take up roughly 1kb */)); |
| 373 | if(blob_size(&pCI->comment)!=0){ |
| 374 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 375 | }else{ |
| 376 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 377 | } |
| 378 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -364,14 +364,10 @@ | |
| 364 | blob_appendf(pOut, "B %s\n", |
| 365 | pCI->pParent->zBaseline |
| 366 | ? pCI->pParent->zBaseline |
| 367 | : pCI->zParentUuid); |
| 368 | } |
| 369 | if(blob_size(&pCI->comment)!=0){ |
| 370 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 371 | }else{ |
| 372 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 373 | } |
| 374 |