Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fix issues with the prior commit on this branch. The small-stack non-recursive implementation appears to be working. Ticket [2a1e8e3c4b0b39e08fdde]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | small_stack |
| Files: | files | file ages | folders |
| SHA1: |
f93a54d0bafffc9e2548e9fb54801f12 |
| User & Date: | drh 2010-10-05 03:24:52.000 |
| Original Comment: | Fix issues with the prior commit on this branch. The small-stack non-recursive implementation appears to be working. Ticket [2a1e8e3c4b0b39e08fdde]. |
Context
|
2010-10-05
| ||
| 03:29 | Merge the small-stack changes into the trunk. This completes the fix for ticket [2a1e8e3c4b0b39e08fdde] ... (check-in: b8f134bbbb user: drh tags: trunk) | |
| 03:24 | Fix issues with the prior commit on this branch. The small-stack non-recursive implementation appears to be working. Ticket [2a1e8e3c4b0b39e08fdde]. ... (Closed-Leaf check-in: f93a54d0ba user: drh tags: small_stack) | |
| 02:46 | An attempt to reduce the depth of recursion in order to run better on systems with limited stack spack. Ticket [2a1e8e3c4b0b39e08fdde0]. This check-in compiles and runs but has issues. ... (check-in: 9664989c0f user: drh tags: small_stack) | |
Changes
Changes to src/content.c.
| ︙ | ︙ | |||
100 101 102 103 104 105 106 | p->age = contentCache.nextAge++; contentCache.szTotal += blob_size(pBlob); p->content = *pBlob; blob_zero(pBlob); bag_insert(&contentCache.inCache, rid); } | < < < < < < < < < < < < < < < | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
p->age = contentCache.nextAge++;
contentCache.szTotal += blob_size(pBlob);
p->content = *pBlob;
blob_zero(pBlob);
bag_insert(&contentCache.inCache, rid);
}
/*
** Clear the content cache.
*/
void content_clear_cache(void){
int i;
for(i=0; i<contentCache.n; i++){
blob_reset(&contentCache.a[i].content);
|
| ︙ | ︙ | |||
278 279 280 281 282 283 284 |
nAlloc = nAlloc*2 + 10;
a = realloc(a, nAlloc*sizeof(a[0]));
if( a==0 ) fossil_panic("out of memory");
}
a[n] = nextRid;
}
mx = n;
| | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
nAlloc = nAlloc*2 + 10;
a = realloc(a, nAlloc*sizeof(a[0]));
if( a==0 ) fossil_panic("out of memory");
}
a[n] = nextRid;
}
mx = n;
rc = content_get(a[n], pBlob);
n--;
while( rc && n>=0 ){
rc = content_of_blob(a[n], &delta);
if( rc ){
blob_delta_apply(pBlob, &delta, &next);
blob_reset(&delta);
if( (mx-n)%8==0 ){
content_cache_insert(a[n+1], pBlob);
}else{
blob_reset(pBlob);
}
*pBlob = next;
}
n--;
}
free(a);
if( !rc ) blob_reset(pBlob);
}
if( rc==0 ){
bag_insert(&contentCache.missing, rid);
}else{
bag_insert(&contentCache.available, rid);
}
return rc;
}
/*
** COMMAND: artifact
**
** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME?
**
** Extract an artifact by its SHA1 hash and write the results on
|
| ︙ | ︙ |
Changes to src/rebuild.c.
| ︙ | ︙ | |||
155 156 157 158 159 160 161 |
if( zFNameFormat==0 ){
/* We are doing "fossil rebuild" */
manifest_crosslink(rid, pUse);
}else{
/* We are doing "fossil deconstruct" */
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
char *zFile = mprintf(zFNameFormat, zUuid, zUuid+prefixLength);
| | < | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
if( zFNameFormat==0 ){
/* We are doing "fossil rebuild" */
manifest_crosslink(rid, pUse);
}else{
/* We are doing "fossil deconstruct" */
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
char *zFile = mprintf(zFNameFormat, zUuid, zUuid+prefixLength);
blob_write_to_file(pUse,zFile);
free(zFile);
free(zUuid);
}
blob_reset(pUse);
rebuild_step_done(rid);
/* Call all children recursively */
|
| ︙ | ︙ |
Changes to src/xfer.c.
| ︙ | ︙ | |||
117 118 119 120 121 122 123 |
blob_zero(&hash);
blob_extract(pXfer->pIn, n, &content);
if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){
/* Ignore files that have been shunned */
return;
}
if( pXfer->nToken==4 ){
| | | > > | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
blob_zero(&hash);
blob_extract(pXfer->pIn, n, &content);
if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){
/* Ignore files that have been shunned */
return;
}
if( pXfer->nToken==4 ){
Blob src, next;
srcid = rid_from_uuid(&pXfer->aToken[2], 1);
if( content_get(srcid, &src)==0 ){
rid = content_put(&content, blob_str(&pXfer->aToken[1]), srcid);
pXfer->nDanglingFile++;
db_multi_exec("DELETE FROM phantom WHERE rid=%d", rid);
content_make_public(rid);
return;
}
pXfer->nDeltaRcvd++;
blob_delta_apply(&src, &content, &next);
blob_reset(&src);
blob_reset(&content);
content = next;
}else{
pXfer->nFileRcvd++;
}
sha1sum_blob(&content, &hash);
if( !blob_eq_str(&pXfer->aToken[1], blob_str(&hash), -1) ){
blob_appendf(&pXfer->err, "content does not match sha1 hash");
}
|
| ︙ | ︙ |