Commit graph

148 commits

Author SHA1 Message Date
Con Kolivas d8df50c9b7 Update various copyright dates. 2013-09-02 12:21:54 +10:00
Con Kolivas 21925e4a9c Massive files fail with -U due to trying to allocate the whole lot in ram while doing checksums. Do it piecemeal to avoid the problem. Patch and debugging courtesy of Adam Tkáč. 2013-09-01 15:46:48 +10:00
Con Kolivas 4db4641dae Add a control lock mutex for protecting certain control variables. 2013-09-01 12:11:51 +10:00
Con Kolivas 37ef39e70a Fix stdin fake mremap creating null bytes on osx, patch courtesy of John Boyle. 2013-09-01 08:43:28 +10:00
Con Kolivas 2c1dda7b73 Cache frequently used indirectly referenced variables in the sliding mmap code. 2013-03-19 00:17:52 +11:00
Con Kolivas 87fe625829 Micro-optimise sliding_get_sb_range. 2013-03-18 23:58:10 +11:00
Con Kolivas 2df8968e75 A fix for a bug where large files containing the same non-zero bytes which requires a sliding window, courtesy of Serge Belyshev. 2013-03-18 23:50:32 +11:00
Con Kolivas ccf225f710 Put vchar should take a 64 bit integer and is used from more than one call site so uninline it. 2012-12-31 16:02:54 +11:00
Con Kolivas 6f0410d28f Microoptimise in hash_search. 2012-12-31 15:02:49 +11:00
Con Kolivas e1fd5d6d11 Inline rzip functions used from only one caller. 2012-12-31 13:24:33 +11:00
Con Kolivas 0b8c0818a0 Check for successful calloc of hash table only after performing it. 2012-12-31 13:16:03 +11:00
Con Kolivas 5591639863 stdin_eof is just a bool 2012-12-31 13:09:47 +11:00
Con Kolivas 02b3250639 hash_bits can only be up to 64 so use a char type. 2012-12-31 13:04:06 +11:00
Con Kolivas 184a8f0025 Rename lrzip.h to lrzip_core.h to cope with case insensitive filesystems not working with Lrzip.h vs lrzip.h 2012-07-07 21:39:40 +10:00
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