Re: [webkit-dev] malloc(0)

2012-06-19 Thread Myles C. Maxfield
http://sourceforge.net/mailarchive/message.php?msg_id=29406824 http://bugs.icu-project.org/trac/ticket/9396 There was a fair amount of activity on my WebKit patch (thanks everyone!) ( https://bugs.webkit.org/show_bug.cgi?id=88936) but it seems to have stopped. Did I do something wrong? Thanks, My

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Myles C. Maxfield
I started a thread on icu-design (mailing list) about it. As soon as it appears in the archives, I'll post a permalink to the thread. The null pointer check shouldn't matter - if the pointer isn't null, then it's valid anyway :-) --Myles On Wed, Jun 13, 2012 at 3:37 PM, Benjamin Poulain wrote:

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Benjamin Poulain
On Wed, Jun 13, 2012 at 3:27 PM, Darin Adler wrote: > > There is still the question of if I can upstream this to ICU, which I'm > > checking on. > > I was not proposing changing ICU. I did. In addition to changing WebKit, not using the pointer when the length is zero does not necessarily seem lik

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Darin Adler
On Jun 13, 2012, at 2:24 PM, Myles C. Maxfield wrote: > There is still the question of if I can upstream this to ICU, which I'm > checking on. I was not proposing changing ICU. > In the meantime, Ryosuke Niwa has a good argument for option 3) above. Yes, that’s what I was suggesting; I am gla

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Myles C. Maxfield
There is still the question of if I can upstream this to ICU, which I'm checking on. In the meantime, Ryosuke Niwa has a good argument for option 3) above. I have uploaded a new patch to https://bugs.webkit.org/show_bug.cgi?id=88936that moves the NULL pointer check to inside the ICU-specific colla

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Benjamin Poulain
On Wed, Jun 13, 2012 at 12:48 PM, Myles C. Maxfield wrote: > I don't think that a good solution is to change the interface of > ICU and try to upstream a patch to ICU - I think a better solution would be > to work around this "requirement" of ICU inside WebKit. What is exactly the problem with th

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Ryosuke Niwa
On Wed, Jun 13, 2012 at 12:48 PM, Myles C. Maxfield < myles.maxfi...@gmail.com> wrote: > I think the fact that ICU thinks that a null pointer is an invalid string > isn't necessarily an incorrect one. It's just a quirk of an interface to a > library. I don't think that a good solution is to change

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Myles C. Maxfield
Thanks for the quick responses and the bug link about fastMalloc(0). In comment 11 , Eric Seidel says that he was going to start a discussion on webkit-dev, but I haven't been able to find such a conversation (by looking both on gmane and on googl

Re: [webkit-dev] malloc(0)

2012-06-13 Thread Zoltan Horvath
Hi, The bug report about fastMalloc(0): https://bugs.webkit.org/show_bug.cgi?id=55097 Brewmp had conditions for fastMalloc(0) earlier, but it was removed in: http://trac.webkit.org/changeset/9/trunk/Source/JavaScriptCore/wtf/FastMalloc.cpp Cheers, On Wed, 13 Jun 2012 00:08:48 +0200, Adam

Re: [webkit-dev] malloc(0)

2012-06-12 Thread Darin Adler
On Jun 12, 2012, at 3:03 PM, Myles C. Maxfield wrote: > I noticed that this caused a problem in one particular place > (WTF::StringImpl::getData16SlowCase()) where the code allocates (constant * > length) bytes for an (empty) string, and provides an accessor that exposes > this pointer. This p

Re: [webkit-dev] malloc(0)

2012-06-12 Thread Adam Barth
There was some discussion about how to handle malloc(0) a year or so ago. I don't remember if it was on webkit-dev, but you might want to check the archives. Eric Seidel might remember what conclusions (if any) we came to. Adam On Tue, Jun 12, 2012 at 3:03 PM, Myles C. Maxfield wrote: > Hello

[webkit-dev] malloc(0)

2012-06-12 Thread Myles C. Maxfield
Hello, I'm compiling WebKit with a malloc() implementation that returns NULL for malloc(0). According to C99, this is valid: "If the size of the space requested is zero, the behavior is implementation- defined: either a null pointer is returned, or the behavior is as if the size were some nonzero va