]> mj.ucw.cz Git - libucw.git/commitdiff
Moved *_IS_MMAP to CONFIG_UCW_* namespace.
authorMartin Mares <mj@ucw.cz>
Thu, 30 Oct 2008 19:13:31 +0000 (20:13 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 30 Oct 2008 19:13:31 +0000 (20:13 +0100)
BTW, PARTMAP_IS_MMAP was broken for a long time: the configure script
was setting PARTMAP_IS_MMAP, while partmap.c expected CONFIG_PARTMAP_IS_MMAP.

ucw/mempool.c
ucw/partmap.c
ucw/perl/UCW/Configure/LibUCW.pm

index fe85a8c581b1f07b51a06519b5300e6e3b9a302e..d04e15ef815510bf1a97e42d859b4b05daa01a86 100644 (file)
@@ -26,7 +26,7 @@ struct mempool_chunk {
 static uns
 mp_align_size(uns size)
 {
-#ifdef POOL_IS_MMAP
+#ifdef CONFIG_UCW_POOL_IS_MMAP
   return ALIGN_TO(size + MP_CHUNK_TAIL, CPU_PAGE_SIZE) - MP_CHUNK_TAIL;
 #else
   return ALIGN_TO(size, CPU_STRUCT_ALIGN);
@@ -61,7 +61,7 @@ mp_free_big_chunk(struct mempool_chunk *chunk)
 static void *
 mp_new_chunk(uns size)
 {
-#ifdef POOL_IS_MMAP
+#ifdef CONFIG_UCW_POOL_IS_MMAP
   struct mempool_chunk *chunk;
   chunk = page_alloc(size + MP_CHUNK_TAIL) + size;
   chunk->size = size;
@@ -74,7 +74,7 @@ mp_new_chunk(uns size)
 static void
 mp_free_chunk(struct mempool_chunk *chunk)
 {
-#ifdef POOL_IS_MMAP
+#ifdef CONFIG_UCW_POOL_IS_MMAP
   page_free((void *)chunk - chunk->size, chunk->size + MP_CHUNK_TAIL);
 #else
   mp_free_big_chunk(chunk);
index ed74df363219608c6c58b60e0da0f047aaa85c28..962b04bfefa00096371bec672894850a61ab906c 100644 (file)
@@ -19,7 +19,7 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 
-#ifdef CONFIG_PARTMAP_IS_MMAP
+#ifdef CONFIG_UCW_PARTMAP_IS_MMAP
 #define PARTMAP_WINDOW ~(size_t)0
 #else
 #ifdef TEST
@@ -40,7 +40,7 @@ partmap_open(char *name, int writeable)
   if ((p->file_size = ucw_seek(p->fd, 0, SEEK_END)) < 0)
     die("lseek(%s): %m", name);
   p->writeable = writeable;
-#ifdef CONFIG_PARTMAP_IS_MMAP
+#ifdef CONFIG_UCW_PARTMAP_IS_MMAP
   partmap_load(p, 0, p->file_size);
 #endif
   return p;
index 445c4a262956da4d6d65e820182bed146fea7919..ef09fa315cdca59102465a3f83ed7f3ccb7c9999 100644 (file)
@@ -26,10 +26,10 @@ if (IsSet("CONFIG_LARGE_FILES") && IsSet("CONFIG_LINUX")) {
 }
 
 # Decide how will ucw/partmap.c work
-Set("PARTMAP_IS_MMAP") if IsSet("CPU_64BIT_POINTERS");
+Set("CONFIG_UCW_PARTMAP_IS_MMAP") if IsSet("CPU_64BIT_POINTERS");
 
 # Option for ucw/mempool.c
-Set("POOL_IS_MMAP");
+Set("CONFIG_UCW_POOL_IS_MMAP");
 
 # Guess optimal bit width of the radix-sorter
 if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) {