On Jan 10, 2008 7:55 AM, Marco Costalba <mcostalba@gmail.com> wrote:Looking at the git sources I have found that zip routines are candidate for a cleaning up, as example the more or less very similar lines of code are repeated many times in git files: memset(&stream, 0, sizeof(stream)); deflateInit(&stream, pack_compression_level); maxsize = deflateBound(&stream, size); out = xmalloc(maxsize); stream.next_out = out; stream.avail_out = maxsize; So what I'm planning to do to test with different algorithms is first a cleanup work that is more or less the following - Remove #include <zlib.h> from cache.h and substitute with #include "compress.h" - Add #include <zlib.h> where it is "really" intended as example archive-zip.c - Rename inflate()/deflate() and other zlib calls with corresponding zlib_inflate() zlib_deflate() and declared in compress.h - Define zlib_inflate() and friends as simple wrappers to corresponding zlib function - Test if everything is ok (should be only code shuffling/renaming until now) - Start cleaning up as example adding a do_deflateInit() that wraps all the code I have reported above and that involves deflateInit() - When compression routines are cleaned up add new functions do_inflate(), do_deflate() instead of zlib_* ones that wrap the compression alghorithm dispatching logic. Dispatching could be choose in different ways going from - compile time (at #define level) - config (some configuration value stored in some global variable) - dynamic (at run time, with no configuration needed, I have some ideas on this ;-) Comments? Thanks Marco - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| David Miller | Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers. |
| Andrew Morton | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Felix von Leitner | socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0 |
git: | |
