From 001dd895bf7e5b7b05ebd715715c560566de222b Mon Sep 17 00:00:00 2001 From: Alcaro Date: Wed, 12 Feb 2014 00:26:06 +0100 Subject: [PATCH] Trim off some function call overhead. --- rewind-alcaro.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rewind-alcaro.c b/rewind-alcaro.c index 5a78229432..576c9a4c8a 100644 --- a/rewind-alcaro.c +++ b/rewind-alcaro.c @@ -309,9 +309,10 @@ static const void * pull(struct rewindstack * this_) uint16_t numchanged=*(compressed16++); if (numchanged) { - uint16_t numunchanged=*(compressed16++); - out16+=numunchanged; - memcpy(out16, compressed16, numchanged*sizeof(uint16_t)); + out16+=*(compressed16++); + //we could do memcpy, but it seems that function call overhead is high + // enough that memcpy's higher speed for large blocks won't matter + for (int i=0;idata=NULL; this->thisblock=NULL; this->nextblock=NULL; + this->capacity=0; + this->blocksize=0; reset((struct rewindstack*)this, blocksize, capacity);