After many merry rounds of compilation and discovery, it seems that the 
ndk-build's compiler -falign-functions[=n] and friends align functions relative 
to this option, but off by one (+1, or is that just |1?).;-)

In pico.h, sadly, I besmirched the code thusly,

#ifdef ANDROID_ARM
// android arm seems to have weird off-by-one alignment
#define FUNCT2LISP_ALIGN(f)     ((f)-1) // hopefully optimise to 
#define LISP2FUNCT_ALIGN(f)     ((f)+1) // a single  inc  ...
#else
#define FUNCT2LISP_ALIGN(f)     (f)
#define LISP2FUNCT_ALIGN(f)     (f)
#endif

#define evSubr(f,x)     (*(fun)( LISP2FUNCT_ALIGN( num(f) ) & ~2 ) )(x)

so in boxSubr in main.c, 

   if (num(FUNCT2LISP_ALIGN(f)) & 3)
      giveup("Unaligned Function");
   return (any)(num(FUNCT2LISP_ALIGN(f)) | 2);

(Er, I bet I missed some places, need to check.)

And then to talk with java I used the miniPicoLisp string-based library mods 
mentioned earlier, with a little jni C glue to hold it together. 

Cheers,

Doug


--- On Mon, 1/23/12, Jakob Eriksson <[email protected]> wrote:

> From: Jakob Eriksson <[email protected]>
> Subject: Re: PicoLisp is DEAD (Was: PicoLisp and its (lack of) libraries)
> To: [email protected]
> Date: Monday, January 23, 2012, 11:47 PM
> 
> 
> On January 24, 2012 at 7:49 AM Doug Snead <[email protected]>
> wrote:
> 
> >
> > I have a (slightly hacked) version of miniPicoLisp
> running as an android
> > native library as a proof of concept.  No no
> additional java interpretation
> > penalty.
>  
>  
> Wow, this is interesting!
>  
>  
> >
> > My thought is that now I have a new tool - a way to
> make picolisp and pilog
> > (prolog) work in android, but will do the UI in java
> like most android apps.
>  
>  
> That is how I plan to use (mini)PicoLisp in my program too.
>  
>  
>  
> >
> > But miniPicoLisp is pure, and easier to port.
>  
> Indeed, and for me the most interesting right now.
>  
> best regards,
> Jakob
>  
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
>
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to