[webkit-dev] SquirrelFish Extreme for non x-86 platforms

Oliver Hunt oliver at apple.com
Thu Dec 25 03:51:39 PST 2008


You can manually align the memory, eg.
char* memory = malloc(size + alignment - 1);
memory += alignment;
memory &= ~(alignment - 1)
return memory;

The obvious problem with this is that you can't directly free the  
result as it will not necessarily represent the start of the  
allocation, but there are mechanisms for working around that (storing  
the initial allocation address inline in the allocation itself for  
instance) but there are various trade offs involved.

--Oliver

On Dec 25, 2008, at 3:14 AM, Javed Rabbani wrote:

> Oliver,
>
> Thanks a great deal for this explanation. I am considering running  
> JS SquirrelFish extreme engine on an ARM-based embedded platform.  
> You are right that posix systems should provide mmap or  
> posix_memalign that will serve the purpose. I am concerned about  
> this issue because in my case, there is no mmap, vm_map etc. to do  
> the job. The only available option is to use standard memory  
> allocation routines. What is the way out for me to deal with such a  
> situation? Obviously, standard malloc() call from within  
> fastMalloc() is not doing anything good for me.
>
>
> Regards,
> J R Shah

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20081225/f02d0912/attachment.html>


More information about the webkit-dev mailing list