Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Issue 7795008: Remove the free_ member of scoped_ptr_malloc. (Closed)

Created:
9 years, 3 months ago by Evan Martin
Modified:
9 years, 2 months ago
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Remove the free_ member of scoped_ptr_malloc. Conceptually, the function to call is known at compile time. There is no reason to save it into a static variable. It turns out doing causes the compiler to emit a static initializer to track whether free_ has been initialized. This change removes static initializers from eight .o files on my local Release build. BUG=87171 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98718

Patch Set 1 #

Total comments: 1

Patch Set 2 : fix #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -7 lines) Patch
M base/memory/scoped_ptr.h View 1 3 chunks +3 lines, -7 lines 1 comment Download

Messages

Total messages: 12 (0 generated)
Evan Martin
I'm a little worried that some caller is relying on us initializing the FreeProc at ...
9 years, 3 months ago (2011-08-29 21:34:04 UTC) #1
Mark Mentovai
This change needs a BUG=. I may have filed a bug about this once.
9 years, 3 months ago (2011-08-29 21:39:43 UTC) #2
Mark Mentovai
LGTM. The history of this (upstream) is ugly.
9 years, 3 months ago (2011-08-29 21:40:11 UTC) #3
Evan Martin
On 2011/08/29 21:39:43, Mark Mentovai wrote: > This change needs a BUG=. What for? > ...
9 years, 3 months ago (2011-08-29 21:40:57 UTC) #4
Mark Mentovai
evan@chromium.org wrote: > On 2011/08/29 21:39:43, Mark Mentovai wrote: >> >> This change needs a ...
9 years, 3 months ago (2011-08-29 21:42:07 UTC) #5
awong
LGTM with one mild suggestion. http://codereview.chromium.org/7795008/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): http://codereview.chromium.org/7795008/diff/1/base/memory/scoped_ptr.h#newcode288 base/memory/scoped_ptr.h:288: FreeProc()(ptr_); nit: What about ...
9 years, 3 months ago (2011-08-29 21:45:11 UTC) #6
Mark Mentovai
Yes, I did file a bug about this. BUG=87171
9 years, 3 months ago (2011-08-29 21:48:16 UTC) #7
Evan Martin
bug updated, code updated to ajwong suggestion
9 years, 3 months ago (2011-08-29 21:55:39 UTC) #8
Mark Mentovai
LGTM
9 years, 3 months ago (2011-08-29 22:05:04 UTC) #9
darin (slow to review)
Feels like deja-vu. I remember wondering about why this was a static instance... what kept ...
9 years, 3 months ago (2011-08-29 23:32:10 UTC) #10
joth
Glad this made it in eventually! On 2011/08/29 23:32:10, darin wrote: > Feels like deja-vu. ...
9 years, 2 months ago (2011-10-17 15:30:52 UTC) #11
darin (slow to review)
9 years, 2 months ago (2011-10-17 15:39:23 UTC) #12
On Mon, Oct 17, 2011 at 8:30 AM, <joth@chromium.org> wrote:

> Glad this made it in eventually!
>
> On 2011/08/29 23:32:10, darin wrote:
>
>> Feels like deja-vu.  I remember wondering about why this was a static
>> instance...  what kept me from making this very same change?...
>>
>
>
> Sorry about the deja-vu -- that was my bad. We had an email thread about it
> last
> year (I drafted
http://codereview.chromium.**org/3031001/<http://codereview.chromium.org/3031...
an illustration for
> that thread) but we got bogged down in discussion whether the divergence
> from
> other (i.e. google internal) versions was bad. I took up the conversation
> over
> there (see http://cl/16515990) but it died a death.
>
>
Ah!


>
> Anyway, should we merge this change into the other chrome copies of
> scoped_ptr.h? That way at least we'll be self-consistent.
>
> gpu/command_buffer/common/**scoped_ptr.h
> third_party/cld/base/scoped_**ptr.h
> third_party/cld/base/scoped_**ptr.h
> (and third_party/libjingle/mods-**since-v0_4_0.diff)
>
>
I think native client may have a copy too!

Merging it into the other copies seems like a nice thing to do.

-Darin



>
>
>
http://codereview.chromium.**org/7795008/<http://codereview.chromium.org/7795...
>

Powered by Google App Engine
This is Rietveld 408576698