Hi Andy

I realised I was having problems with the newest stable and not with
an older version, so I went back through and did some bisecting. r1725
appears to cause issues for me when generating large gmapsupp.img

Well that is very interesting as that change is directly about creating gmapsupp.img files.

It originate from the following:

http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2010q4/009328.html

Looking at this again, I think that although the original code is 'obviously' wrong, the new code is not correct either. It should be
Dirent.ENTRY_SIZE instead of DirectoryEntry.SLOTS_PER_ENTRY.

And the assert should definitely be there. There are two reasons for that. 1) I don't know that numbers other than 1 are allowed. 2) The rest of the code is written to make it 1. If that code is failing we need to know about it.

Attached patch is what I think it should be.

..Steve

Index: src/uk/me/parabola/imgfmt/sys/Directory.java
===================================================================
--- src/uk/me/parabola/imgfmt/sys/Directory.java	(revision 1751)
+++ src/uk/me/parabola/imgfmt/sys/Directory.java	(revision )
@@ -152,12 +152,12 @@
 		long dirPosition = chan.position();
 		int blockSize = headerBlockManager.getBlockSize();
 
-		int forHeader = (blocks + DirectoryEntry.SLOTS_PER_ENTRY - 1)/DirectoryEntry.SLOTS_PER_ENTRY;
+		int forHeader = (blocks + Dirent.ENTRY_SIZE - 1)/Dirent.ENTRY_SIZE;
 		log.debug("header blocks needed", forHeader);
 
 		// There is nothing really wrong with larger values (perhaps, I don't
 		// know for sure!) but the code is written to make it 1, so make sure that it is.
-		//assert forHeader == 1;
+		assert forHeader == 1;
 
 		// Write the blocks that will will contain the header blocks.
 		chan.position(dirPosition + (long) forHeader * Dirent.ENTRY_SIZE);
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to