-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #472 from restic/update-chunker
Update chunker
- Loading branch information
Showing
11 changed files
with
351 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package restic | ||
|
||
import ( | ||
"sync" | ||
|
||
"github.com/restic/chunker" | ||
) | ||
|
||
var bufPool = sync.Pool{ | ||
New: func() interface{} { | ||
return make([]byte, chunker.MinSize) | ||
}, | ||
} | ||
|
||
func getBuf() []byte { | ||
return bufPool.Get().([]byte) | ||
} | ||
|
||
func freeBuf(data []byte) { | ||
bufPool.Put(data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
[![GoDoc](https://godoc.org/github.com/restic/chunker?status.svg)](http://godoc.org/github.com/restic/chunker) | ||
[![Build Status](https://travis-ci.org/restic/chunker.svg?branch=master)](https://travis-ci.org/restic/chunker) | ||
|
||
Content Defined Chunking (CDC) based on a rolling Rabin Checksum. | ||
|
||
Part of https://github.com/restic/restic. | ||
The package `chunker` implements content-defined-chunking (CDC) based on a | ||
rolling Rabin Hash. The library is part of the [restic backup | ||
program](https://github.com/restic/restic). | ||
|
||
An introduction to Content Defined Chunking can be found in the restic blog | ||
post [Foundation - Introducing Content Defined Chunking (CDC)](https://restic.github.io/blog/2015-09-12/restic-foundation1-cdc/). | ||
post [Foundation - Introducing Content Defined Chunking (CDC)](https://restic.github.io/blog/2015-09-12/restic-foundation1-cdc). | ||
|
||
You can find the API documentation at | ||
https://godoc.org/github.com/restic/chunker |
Oops, something went wrong.