cdefs: changed the order of arguments to malloc - you might not have a type, so put it last.  Also, it matches the order in mmapfile
sort out syscall and mmapfile at the top of the file, not waay down the bottom
if mmapfile.malloc is available, use it.  It's slow, but the problem with kdtrees has been memory, not speed, and getting as much as possible above 4G is all good
share axis tables between invocations of split.  This saves a whole lot of temporary tables, and so saves memory growth and catastrophe
add a yield argument to query so that you can control how objects are passed out of the query
whoops!  Indenting