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
| Stephen Smalley | Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
git: | |
| David Fenyes | sigsetmask()? (LINUX) |
| Stephen Tweedie | Unmounting root (no kidding!) [was: Some Linux problems---solved] |
| Les Andrzejewski | X386/WD90C31/SUMSUNG SYNC MASTER 4 |
| Doug Evans | Re: Stabilizing Linux |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Herbert Xu | Re: [PATCH] myr10ge: again fix lro_gen_skb() alignment |
