Bug 30778 - GraphicsContext3D should be using fastMalloc
Summary: GraphicsContext3D should be using fastMalloc
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-26 09:18 PDT by Simon Fraser (smfr)
Modified: 2009-12-01 08:10 PST (History)
2 users (show)

See Also:


Attachments
Patch with updated test case (5.99 KB, patch)
2009-12-01 07:31 PST, Chris Marrin
aroben: review-
Details | Formatted Diff | Diff
Replacement patch (6.58 KB, patch)
2009-12-01 08:05 PST, Chris Marrin
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-10-26 09:18:32 PDT
GraphicsContext3D has a bunch of malloc() calls that should be using fastMalloc.
Comment 1 Chris Marrin 2009-12-01 06:45:42 PST
Landed in http://trac.webkit.org/changeset/51535
Comment 2 Chris Marrin 2009-12-01 06:50:31 PST
Sorry, closed wrong bug. Ignore previous comment
Comment 3 Chris Marrin 2009-12-01 07:31:05 PST
Created attachment 44074 [details]
Patch with updated test case
Comment 4 WebKit Review Bot 2009-12-01 07:31:23 PST
style-queue ran check-webkit-style on attachment 44074 [details] without any errors.
Comment 5 Adam Roben (:aroben) 2009-12-01 07:47:19 PST
Comment on attachment 44074 [details]
Patch with updated test case

> -    GLchar* info = (GLchar*) malloc(length);
> +    GLchar* info = (GLchar*) fastMalloc(length);
> +    if (!info)
> +        return "";
> +
>      ::glGetProgramInfoLog((GLuint) program->object(), length, &size, info);
>      String s(info);
>      free(info);

If you use fastMalloc, you need to use fastFree, too.
Comment 6 Adam Roben (:aroben) 2009-12-01 07:49:50 PST
Comment on attachment 44074 [details]
Patch with updated test case

> +// Test program and shader gets
> +var parseError = "ERROR: 0:1: 'I' : syntax error syntax error\nERROR: Parser found no code to compile in source strings.\n";
> +var errorVertString = "I am a bad vertex shader\n";
> +var errorFragString = "I am a bad fragment shader\n";
> +shouldBe('gl.getProgramInfoLog(standardProgram)', '""');
> +shouldBe('gl.getShaderInfoLog(errorVert)', 'parseError');
> +shouldBe('gl.getShaderInfoLog(errorFrag)', 'parseError');
> +shouldBe('gl.getShaderSource(errorVert)', 'errorVertString');
> +shouldBe('gl.getShaderSource(errorFrag)', 'errorFragString');

If you don't quote the second parameter to these functions you'll see the actual error messages in the test output, which might be good. Maybe you should be using shouldBeEqualToString instead?
Comment 7 Chris Marrin 2009-12-01 08:05:40 PST
Created attachment 44079 [details]
Replacement patch

Adds fastFree
Comment 8 Adam Roben (:aroben) 2009-12-01 08:06:50 PST
Comment on attachment 44079 [details]
Replacement patch

r=me
Comment 9 Chris Marrin 2009-12-01 08:10:09 PST
Landed in http://trac.webkit.org/changeset/51537