John:

I believe that it was designed to return the easiest thing to cast (in C) to
what it really is.  I.E. it could be a pointer to an unsigned long -or- another Pointer,
depending what the user put in that memory location.  It turned out (later)
that in C++ this was "awkward" for the Macros JLG() and friends.

Oops, your are talking about the "Judy array pointer".   We debated that one
a lot too.  I vaguely remember there was a caveat that made it more awkward
(to a type other than a void **).   Perhaps C has changed since then.
I think it had to do with one of the tools that did "type" checking (in the 90's).

The Judy API has always been awkward.  I have never been happy with it.
I have received a lot of criticism about it over the years.  I challenge
anyone to come up with a better one, but so far there have been no takers
(that actually deliver a Judy.h file with the prototypes that can possibly work).

I spend most of my time with the internals of Judy.  The API is just something
that C and C++ make awkward (or I am just not smart enough to make it better).

doug
 
Doug Baskins <dougbaskins@yahoo.com>

PS.  Much of the design of Judy was to overcome the CPU design (flaws) of
the early 2000's.  The Macros were done to avoid an extra subroutine
call -- which were extremely costly before the 2006 CPU designs (core 2 duo).

I now struggle with CPU cache/TLB design flaws (I think) which are very
difficult-to-impossible to predict and/or program around.  The symptom is
an apparent TLB miss in the Text cache -- even when the Text working set
is using just 2 pages.  So far this "flaw" has been present in all generations
of Intel CPU's since.  AMD CPU's have been so slow, it is hard to tell.


From: john skaller <skaller@users.sourceforge.net>
To: judy <judy-devel@lists.sourceforge.net>
Sent: Wednesday, November 2, 2011 3:39 AM
Subject: Judy array types

Instead of a void* why not

struct Judy1Array { void *data};
struct JudyLArray { void *data};

This has the small advantage that one can't confuse Judy1Array and JudyLArray,
since they now have distinct types.

--
john skaller
skaller@users.sourceforge.net





------------------------------------------------------------------------------
RSAŽ Conference 2012
Save $700 by Nov 18
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Judy-devel mailing list
Judy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/judy-devel