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.

stephan 2020-08-14 14:38 trunk
Commit b99c069a2c7004f442683a407884eb0b1270a3976733b611a755d349c7c2a9cd
+5
--- src/blob.c
+++ src/blob.c
@@ -487,10 +487,15 @@
487487
**
488488
** For semantic compatibility with blob_append_full(), if newSize is
489489
** >=0x7fff000 (~2GB) then this function will trigger blob_panic(). If
490490
** it didn't, it would be possible to bypass that hard-coded limit via
491491
** 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.
492497
*/
493498
void blob_reserve(Blob *pBlob, unsigned int newSize){
494499
if(newSize>=0x7fff0000 ){
495500
blob_panic();
496501
}else if(newSize>pBlob->nUsed){
497502
--- 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
--- src/fileedit.c
+++ src/fileedit.c
@@ -364,14 +364,10 @@
364364
blob_appendf(pOut, "B %s\n",
365365
pCI->pParent->zBaseline
366366
? pCI->pParent->zBaseline
367367
: pCI->zParentUuid);
368368
}
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 */));
373369
if(blob_size(&pCI->comment)!=0){
374370
blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment));
375371
}else{
376372
blob_append(pOut, "C (no\\scomment)\n", 16);
377373
}
378374
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button