John:
The code of Judy has not changed in over 12 years. However, the compilers and
build methodshave changed. The 64 bit version of Judy was released before
Microsoft had a 64 bit compiler.We did not anticipate Microsoft would define a
64 bit object different that a what every other 64
bit compiler does (a long).
I do not have access to Microsoft development tools, so I have not updated Judy
to work with it.However, I have certainly thought of it. My plan was to first
change every non int-constant to have a
(Word_t) cast. Then typedef a Word_t appropriately (I guess: intptr_t). The
suffix U and L to a
constant just won't work for portable code.
Now on to your problem. I remember when we first ported Judy to a Microsoft 32
bit compiler, the firstproblem was the way a Judy struct jp_t was defined. A
kludge was necessary to define it in such a way that the compiler could not
unpack it into more than 2 Word_t words. A couple years ago I published apatch
to work around a gcc problem. It was another definition of jp_t (in
JudyPrivateBranch.h) to get rid of the "punning" warning messages (and broken
code) from the gcc compiler. It may be possible that the Microsoft 64 bit
compiler could unpack that structure into more than 2 Word_t words -- I have no
idea.I have received 64bit Judy code that author says works with the Microsoft
64 bit compiler. You are
welcome to a copy. I have never compiled it.
Let me know how it comes out.
Thanks for your interest,doug
Doug Baskins <[email protected]>
On Thursday, May 12, 2016 12:23 PM, john skaller
<[email protected]> wrote:
I have a version of Judy that has been modified to work correctly
on Windows. Unforunately I just found another bug, but I have no idea
at all what it is.
Judy doesn’t work on Windows 64 bit because it has “long” assumed
to be 64 bit which it isn’t. I fixed my copy of the code to replace code like
-1L // all bits set
to
-(intptr_t)1
which works on all platforms for both 32 and 64 bits.
However I have just found a bug in JudyLIns.
My code is also not in sync with the latest download from Sourceforge
which seens to be version 1.5, I have no idea what version I modified.
I spot at least one place where files differ.
Just for example this code in the repository is WRONG:
#define JU_LEASTBYTESMASK(BYTES) \
((0x100UL << (cJU_BITSPERBYTE * ((BYTES) - 1))) - 1)
Here is my version which is CORRECT:
#define JU_LEASTBYTESMASK(BYTES) \
(((uintptr_t)0x100UL << (cJU_BITSPERBYTE * ((BYTES) - 1))) - 1)
Another example: WRONG in repository:
#define cJU_ALLONES (~0UL)
CORRECT in my code:
#define cJU_ALLONES (~(uintptr_t)0)
So here:
#define SEARCHLEAFNATIVE(LEAFTYPE,ADDR,POP1,INDEX) \
LEAFTYPE *P_leaf = (LEAFTYPE *)(ADDR); \
LEAFTYPE I_ndex = (LEAFTYPE)INDEX; /* truncate hi bits */ \
Word_t l_ow = cJU_ALLONES; \
Word_t m_id; \
Word_t h_igh = POP1; \
\
while ((h_igh - l_ow) > 1UL)
the code will probably work, since we have integer promotion on the comparison.
Plain 1 would be good enough.
I basically modified things by getting rid of all “long” values and types.
Looks like I missed something. Its a bit hard to tell, so many macros
all over the place.
At present it looks grim: I will have to drop either Windows or Judy.
Or scrap my whole project.
—
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel