Bug 15043 - KJS::allocateBlock(): posix_memalign takes a void** as its first parameter
Summary: KJS::allocateBlock(): posix_memalign takes a void** as its first parameter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-21 17:33 PDT by Ryan Leavengood
Modified: 2007-08-29 10:41 PDT (History)
0 users

See Also:


Attachments
Fix to posix_memalign call in KJS::allocateBlock (1.18 KB, patch)
2007-08-21 17:35 PDT, Ryan Leavengood
no flags Details | Formatted Diff | Diff
The same patch, with the removal of the reinterpret_cast in the memset call (1.22 KB, patch)
2007-08-21 18:28 PDT, Ryan Leavengood
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Leavengood 2007-08-21 17:33:04 PDT
This clearly is not code that any current port uses, since it should not compile without the change attached. But my port makes use of this since it was already in the code, instead of making another #elsif. But as shown by the documentation here:

http://www.opengroup.org/onlinepubs/000095399/functions/posix_memalign.html

the function is being called incorrectly. The simple patch attached corrects that.
Comment 1 Ryan Leavengood 2007-08-21 17:35:04 PDT
Created attachment 16066 [details]
Fix to posix_memalign call in KJS::allocateBlock
Comment 2 Darin Adler 2007-08-21 17:38:53 PDT
Comment on attachment 16066 [details]
Fix to posix_memalign call in KJS::allocateBlock

I also don't think the reinterpret_cast is needed on the next line.
Comment 3 Ryan Leavengood 2007-08-21 17:45:36 PDT
Would you like me to make that change and create another patch, or could you take care of it? :)
Comment 4 Ryan Leavengood 2007-08-21 18:28:52 PDT
Created attachment 16067 [details]
The same patch, with the removal of the reinterpret_cast in the memset call
Comment 5 David Kilzer (:ddkilzer) 2007-08-21 21:46:35 PDT
(In reply to comment #0)
> This clearly is not code that any current port uses, since it should not
> compile without the change attached. But my port makes use of this since it was
> already in the code, instead of making another #elsif. [...]

What port are you working on?  :)

Comment 6 Ryan Leavengood 2007-08-22 06:22:52 PDT
(In reply to comment #5)
> 
> What port are you working on?  :)

I am porting WebKit to Haiku, http://haiku-os.org. It is a clone of BeOS.
Comment 7 Maciej Stachowiak 2007-08-28 21:17:07 PDT
Comment on attachment 16067 [details]
The same patch, with the removal of the reinterpret_cast in the memset call

r=me

Probably other ports could use memalign too, but don't set the right ifdef so they get the generic mmap-based version.
Comment 8 Mark Rowe (bdash) 2007-08-29 10:41:53 PDT
Landed in r25296.