[webkit-reviews] review granted: [Bug 13383] [js-collector-tweaks] Allocate collector blocks aligned : [Attachment 14064] 03-js-gc-aligned-blocks.patch.txt

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 18 11:05:31 PDT 2007


Darin Adler <darin at apple.com> has granted Maciej Stachowiak <mjs at apple.com>'s
request for review:
Bug 13383: [js-collector-tweaks] Allocate collector blocks aligned
http://bugs.webkit.org/show_bug.cgi?id=13383

Attachment 14064: 03-js-gc-aligned-blocks.patch.txt
http://bugs.webkit.org/attachment.cgi?id=14064&action=edit

------- Additional Comments from Darin Adler <darin at apple.com>
Some style nitpicks:

+    uintptr_t ptr = reinterpret_cast<uintptr_t>(result);

This could be a static_cast, because you can cast to/from void* to another
pointer type without reinterpret_cast.

+    if (adjust > 0)
+	 munmap(reinterpret_cast<void*>(ptr), adjust);
+
+    if (adjust < extra)
+	 munmap(reinterpret_cast<void*>(ptr + adjust + BLOCK_SIZE), extra -
adjust);
+
+    ptr += adjust;
+    memset(reinterpret_cast<void*>(ptr), 0, BLOCK_SIZE);

I don't think these need casts at all. You can past any pointer type to void*
as long as it's not a pointer to const or volatile.



More information about the webkit-reviews mailing list