Commit graph

134 commits

Author SHA1 Message Date
Con Kolivas 8b680e72ac Remove redundant code. 2012-03-16 23:14:49 +11:00
Con Kolivas 19b0636459 Move the update counter to earlier in the hash_search so it still updates even when there are not matches. 2012-03-11 21:12:44 +11:00
Con Kolivas 704d7b5eb6 There is no point using a thread on the last checksum update, nor to add the value to cksum_limit. 2012-03-11 12:22:35 +11:00
Con Kolivas 5edf8471d1 Perform all checksumming in a separate thread to speed up the hash search in the rzip phase. 2012-03-11 11:51:36 +11:00
Con Kolivas f4165ec263 Further micro-optimise match_len. 2012-03-11 09:50:42 +11:00
Con Kolivas 261f2ff1e4 Optimise the hot function empty_hash even further. 2012-03-11 09:25:58 +11:00
Con Kolivas 2fada9fb76 Micro-optimise the hot next_tag function. 2012-03-11 02:17:26 +11:00
Con Kolivas c136424140 Micro-optimise the match_len function. 2012-03-11 01:56:40 +11:00
Con Kolivas ba2ebae392 Correct missing adjustment of hash entry. 2012-03-11 01:33:54 +11:00
Con Kolivas 0e593f7681 Pass one less variable to the get_sb function as an optimisation. 2012-03-11 01:04:44 +11:00
Con Kolivas 92c09a7588 Cache the hash_entry value passing one less variable to hash_empty as a micro-optimisation. 2012-03-11 00:52:38 +11:00
Con Kolivas f792f72aa5 Use ffsl for a faster lesser_bitness function. 2012-03-11 00:11:11 +11:00
Con Kolivas cf8567e314 Use as much of the low buffer as possible with a single memcopy before going fine grained byte by byte. 2012-03-08 09:01:31 +11:00
Con Kolivas 754088feb9 Must give the memcpy the sb low offset to work properly. 2012-03-07 23:14:04 +11:00
Con Kolivas 086265c83f Update copyright notices and style to 1TBS for return codes. 2012-03-07 22:04:24 +11:00
ckolivas 1abacd82af Use the single_mcpy function even if we need the sliding mmap buffer if we won't need to be pageing buf_low. 2012-03-07 16:53:18 +11:00
ckolivas 43f407aa04 Remove global variables sliding_buffer get_sb and do_mcpy and put them in rzip_control. 2012-03-07 14:48:21 +11:00
ckolivas a62e78186e Merge branch 'liblrzip' of github.com:ckolivas/lrzip into liblrzip
Conflicts:
	rzip.c
2012-03-07 11:41:35 +11:00
Con Kolivas f496e0705d get_sb only allows accessing one byte at a time, yet we don't need that functionality when sliding mmap is not in use.
User different versions of the function and the larger memcpys depending on whether sliding mmap is in use or not.
This affords a substantial speedup in the rzip phase of files not requiring sliding mmap.
A small optimisation of moving the check for remapping the low buffer also speeds up the sliding mmap version slightly.
2011-09-18 22:29:09 +10:00
discomfitor 3316dd5505 remove trailing whitespace 2011-08-17 20:59:41 +10:00
discomfitor 223a1107ea add info callback which provides percentage completion of operation 2011-08-17 20:59:41 +10:00
discomfitor 63141a1035 add some gross bucketing to implement a queue for freeing stream_info structs after an operation has completed (in library mode ONLY; no changes will occur during regular execution) to fix some leaks 2011-08-17 20:59:41 +10:00
discomfitor 949c6d7a97 another semi-clusterfuck commit: *new logging macros *allow compression to and from any FILE, not just stdin/stdout *update main.c to work with the above 2011-08-17 20:59:41 +10:00
discomfitor 6dd20d735b giant clusterfuck commit: *add and use alloca/strdupa in some spots *implement return values on almost every function *free() is now a macro which also nulls the freed pointer *when in 'library mode', fatal_exit() will not be called *fatal()/failure() are now macros which add line number and file for logging *all occurrences of fatal/failure in files other than main.c are now wrapped to use a logging callback (if specified) and then return *functions now clean up resources on returning with an error 2011-08-17 20:59:40 +10:00
discomfitor 133b201867 move more code out of main.c, allocate outfile suffix 2011-08-17 20:59:40 +10:00
discomfitor cbff8faef7 move liblrzip.h contents to lrzip_private.h global variables----- 2011-08-17 20:59:40 +10:00
Con Kolivas 3e10b27422 More divide by zero output fixes. 2011-05-08 00:45:56 +10:00
Con Kolivas 0d86b8ba0e More percentage display fixes for divide by zero errors. 2011-05-08 00:38:33 +10:00
Con Kolivas a1359276f4 Fix nan when no hashes found in verbose message. 2011-05-08 00:34:09 +10:00
Con Kolivas 1ea75154d6 Silence compiler warnings. 2011-05-08 00:05:46 +10:00
Con Kolivas 55dc9b0095 Fix the arbitrary lower limit of 128 bytes by compressing zeroes beyond the size of the chunk.
Put special case management of zero sized files.
Modify the percentage calculation to be able to cope with small numbers and zeroes.
2011-05-07 18:37:25 +10:00
Con Kolivas 6ceaeb5f93 Progress update percent was being zeroed in rzip.c thus displaying on every loop. Move it higher, fixing the amount of output to the terminal. 2011-05-07 10:19:12 +10:00
ckolivas 127a101b14 Disable md5 checking on apple for now till someone fixes it. 2011-04-13 14:50:26 +10:00
Con Kolivas 70e7866271 Include arpa/inet.h for those OSs that have endian details elsewhere. 2011-03-22 21:47:24 +11:00
ckolivas f56e48c4f2 Modify maxram to mean the most we'll allocate in one chunk and add usable_ram for the most we'll allocate to one task.
Limit all maxram on 32bits to 1GB since most don't like mallocing more than this.
Update testing to allow larger total amount based on usable ram while sticking to maxram limit per alloc.
2011-03-22 12:10:21 +11:00
Con Kolivas 2736118f82 Check for different endian.h includes and variants of le32toh. 2011-03-22 07:57:32 +11:00
Con Kolivas a30efcaa55 Portable generic byteswap for BE. 2011-03-22 00:13:29 +11:00
Con Kolivas c533b031bc Fix trivial compiler warnings. 2011-03-21 23:36:39 +11:00
Con Kolivas 1647b4036d Unused variable. 2011-03-21 21:29:01 +11:00
Con Kolivas 43eb2e4594 Revert "yet yet yet more BE fixes."
This reverts commit 44b93068a3.

Value was not stored but ysed for a memcpy.
2011-03-21 21:27:25 +11:00
Con Kolivas 8c8f5bdd48 lrz_crypt tweaks courtesy of Serge Belyshev. 2011-03-21 20:54:53 +11:00
Con Kolivas 44b93068a3 yet yet yet more BE fixes. 2011-03-21 18:58:38 +11:00
Con Kolivas 2982cb7121 Yet yet more BE fixes. 2011-03-21 16:12:51 +11:00
Con Kolivas ff5a5ed054 Use separate lrz_encrypt and lrz_decrypt wrappers to lrz_crypt. 2011-03-19 14:04:22 +11:00
Con Kolivas 0b1db75a44 Cleanups. 2011-03-19 13:53:43 +11:00
ckolivas 5005c2dff5 Get rid of extra data in new header and stick to old header size, compacting extra info into existing space. 2011-03-18 17:32:47 +11:00
ckolivas b8d8ecfe33 Fix warnings.
Patch ~ by Serge Belyshev.
2011-03-18 10:37:09 +11:00
ckolivas e856d481bf Discard hash_iv entirely, using passphrase hash and centralise key generation.
Patch by Serge Belyshev.
2011-03-18 10:22:58 +11:00
Con Kolivas a3e80871c2 Add 8 bytes of random data to the start of every encrypted compressed block and use it along with 8 bytes from the stored salt to make a unique key and IV for encryption. 2011-03-18 00:06:11 +11:00
ckolivas 4bc23ee001 Centralise where all encryption/decryption is done, and whether to carry over the IV or not. 2011-03-17 14:10:58 +11:00