On Wed, 11 Jun 2003, Nicholas Clark wrote:

> I've got a p6i backlog, so I don't know if this is already solved.
> However, on a fresh CVS checkout on FreeBSD I can't compile:
>
> cc -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith 
> -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Winline -W -Wno-unused 
> -Wsign-compare  -I./include  -DHAS_JIT -DI386 -DHAVE_COMPUTED_GOTO -o platform.o -c 
> platform.c
> platform.c:167: #error "generic platform without memalign"
> *** Error code 1
>
> What's the solution?

I believe that one possibility is to use the supplied malloc.c file, which
has a memalign implementation.

I was about to suggest that you might be able to get by with a
Parrot_memalign() function that either called malloc() directly (if the
requested alignment was only on an 8 or 16 byte boundary anyway) or
perhaps valloc() (if you have it) which gives you data aligned on page
boundaries (typically 8192).  However, looking for a moment, I see that
Parrot_memalign() is being asked for aligment on 4 MB boundaries!  I don't
know how to portably fake that up.

It comes from this section of include/parrot/pobj.h:

    /*
     * arenas are constant sized ~32 byte object size, ~128K objects
     */
    # define ARENA_SIZE (32*1024*128)
    # define ARENA_ALIGN ARENA_SIZE

That size may well be reasonable, but is that alignment really
necessary?

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to