summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-05-07 11:37:25 +0200
committerYorhel <git@yorhel.nl>2010-05-07 11:37:25 +0200
commit24d77af354095ba86c66b7f54853188052b7dff2 (patch)
tree85a9b4f5f22cbf4b68863858734d66fd43134ddb
parent80268772b4bc04e761722db33f61eb96cc514c49 (diff)
Removed debugging code and added README file
-rw-r--r--README24
-rw-r--r--compll.c36
2 files changed, 24 insertions, 36 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..ebbd762
--- /dev/null
+++ b/README
@@ -0,0 +1,24 @@
+compll - A compressed memory allocator
+======================================
+
+DESCRIPTION
+
+ compll is a small library that provides replacement functions for malloc()
+ and free() that allow the application memory to be compressed.
+
+
+INSTALLATION
+
+ Due to the small size of this library, it is recommended to simply add the
+ compll.h and compll.c files to your project and compile and statically link
+ them into your application as if they were part of your project.
+
+ The library should compile on any conforming C99 compiler, or a C89 compiler
+ with support for 'long long' integers. [unsigned] short types are assumed to
+ be exactly 16 bits wide. So far, only GCC has been tested.
+
+ A minimal Makefile is included to build an object file from the library and
+ to run the tests. The test suite requires quite a bit of memory in addition
+ to the 'prove' program, which should come with a default installation of
+ Perl.
+
diff --git a/compll.c b/compll.c
index a1b8324..362f338 100644
--- a/compll.c
+++ b/compll.c
@@ -630,39 +630,3 @@ int compll_init(unsigned int block_size,
}
-
-
-
-/* debugging code while developing the library */
-#ifdef DEBUG
-
-#include <stdio.h>
-
-/* dummy compress/decompress functions */
-unsigned int dbg_compress(const unsigned char *src, unsigned int srclen, unsigned char *dst, unsigned int dstlen) {
- memcpy(dst, src, min(dstlen, srclen));
- return srclen;
-}
-void dbg_decompress(const unsigned char *src, unsigned int srclen, unsigned char *dst, unsigned int dstlen) {
- memcpy(dst, src, min(dstlen, srclen));
-}
-
-
-int main() {
- /*int i;
- compll_t m[10];*/
- FILE *f;
-
- printf("compll_init = %d\n", compll_init(524288, 16, 1, dbg_compress, dbg_decompress));
-
- compll_alloc(0x10000);
-
- f = fopen("dump", "w");
- fwrite(ublocks[block_load(0)].data, conf_blocksize, 1, f);
- fclose(f);
-
- return 0;
-}
-
-#endif
-