/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff-delta.c

  • Committer: Martin
  • Date: 2011-03-04 19:50:44 UTC
  • mto: This revision was merged to the branch mainline in revision 5731.
  • Revision ID: gzlist@googlemail.com-20110304195044-khwv0p51jgjm240l
Change create_delta_index signature so callers can treat NULL returns as MemoryError

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
        if (fit_in_old) {
281
281
            // fprintf(stderr, "Fit all %d entries into old index\n",
282
282
            //                 copied_count);
283
 
            /* No need to allocate a new buffer */
284
 
            return NULL;
 
283
            /*
 
284
             * No need to allocate a new buffer, but return old_index ptr so
 
285
             * callers can distinguish this from an OOM failure.
 
286
             */
 
287
            return old_index;
285
288
        } else {
286
289
            // fprintf(stderr, "Fit only %d entries into old index,"
287
290
            //                 " reallocating\n", copied_count);
450
453
    total_num_entries = limit_hash_buckets(hash, hash_count, hsize,
451
454
                                           total_num_entries);
452
455
    free(hash_count);
453
 
    if (old) {
454
 
        old->last_src = src;
455
 
    }
456
456
    index = pack_delta_index(hash, hsize, total_num_entries, old);
457
457
    free(hash);
458
458
    if (!index) {