Commit Graph

159 Commits

Author SHA1 Message Date
Birunthan Mohanathas
16471161bb Bug 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj 2014-08-25 12:17:24 -07:00
Trevor Saunders
b9b88628a5 [PATCH] bug 1049781 - add move ctor version of
From 43dccd4d360dd2e43182c2f39002dc14567f15c0 Mon Sep 17 00:00:00 2001
 nsTArray::InsertElementAt
---
 xpcom/glue/nsTArray.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
2014-08-06 14:49:37 -04:00
Jeff Muizelaar
d20849c5bf Bug 1044241. Discard tile back buffers that haven't been recently used. r=nical
Tracks tiles that have a back buffer with a nsExpirationTracker and discards
them after a while. This should help us claim back tile memory for tiles
that have stopped changing.

--HG--
extra : rebase_source : 2528de0a6fac08cb6f97ebd946d9f72a63b7d2b1
2014-07-31 23:25:37 -04:00
Jeff Muizelaar
06de3f589e Bug 1039521 - nsTArray: Add an AppendElement take taking a r-value reference. r=froydnj
This lets us store UniquePtr's in nsTArrays

--HG--
extra : rebase_source : d7ea9ef710bd2451d0e2e9ba1aaefa9559315875
2014-07-18 09:43:42 -04:00
Birunthan Mohanathas
c9fb2c0d48 Bug 1022456 - Fix modelines in xpcom/{base,glue,io,string,threads}/. r=froydnj 2014-06-30 08:39:45 -07:00
Birunthan Mohanathas
6b53f3d634 Bug 1022456 - Convert xpcom/glue/ to Gecko style. r=froydnj 2014-06-26 18:35:39 -07:00
Carsten "Tomcat" Book
8bf7369627 Backed out changeset 1b81b771aee6 (bug 1017418) 2014-06-02 11:26:12 +02:00
Nicholas Nethercote
acaeec85e8 Bug 1017418 (part 2) - Avoid more slop in nsTArray. r=froydnj. 2014-06-01 16:08:50 -07:00
Brian Smith
47e2bb46f2 Bug 1010634, Part 2: Fix compiler warnings in MFBT and XPCOM, r=ehsan
--HG--
extra : rebase_source : 8839297479ce2ade7a7e6cb5099178e799a0e516
2014-05-29 20:18:29 -07:00
Benoit Jacob
7552512772 Bug 852393 - Specialize nsAutoTArray<T, 0> to be an nsTArray - r=froydnj 2014-05-29 11:59:37 -04:00
David Major
5abce313e8 Bug 1014288: Fix the OOM check in nsTArrayInfallibleAllocator::Realloc. r=bsmedberg 2014-05-28 14:45:15 +12:00
Ehsan Akhgari
52accff3a3 Bug 1013664 - Fix bad implicit conversion constructors in XPCOM; r=froydnj
--HG--
extra : rebase_source : e3260a536292175cb1ad23a53dfe9e3f4bb8ff10
2014-05-21 21:33:28 -04:00
Benoit Jacob
60d536773a Bug 1004098 - Make nsTArray use size_t in its interface (32bitness is fine as an internal detail) - r=froydnj, sr=bsmedberg 2014-05-08 21:03:35 -04:00
Randell Jesup
1c0a493d1d Bug 940329: avoid warnings from using size_t in ImplCycleCollectionTraverse() r=ehsan 2014-04-27 00:29:18 -04:00
Chris Peterson
8dfd5d9398 Backed out changeset 18034a2d0732 (bug 940329) for build bustage 2014-04-26 23:11:47 -07:00
Randell Jesup
9ace4688fe Bug 940329: avoid warnings from using size_t in ImplCycleCollectionTraverse() r=ehsan 2014-04-27 00:29:18 -04:00
L. David Baron
03ba2e465b Bug 976350 patch 1: Move the contents of nsTraceRefcnt.h into nsISupportsImpl.h. r=bsmedberg
This makes sense since the file no longer contains anything with the
nsTraceRefcnt name in it, and it will allow renaming nsTraceRefcntImpl
back to nsTraceRefcnt.
2014-02-26 13:36:35 -08:00
Ehsan Akhgari
c1dc0a9245 Bug 969864 - Make nsTArray::SetLength return void; r=froydnj 2014-02-19 08:27:15 -05:00
Neil Rashbrook
cab4409bb2 Bug 972167 Followup to make the code compile now that it's actually being used
a=KWierso for checkin to a CLOSED TREE
2014-02-13 21:07:46 +00:00
Neil Rashbrook
f83a4c3cb1 Bug 972167 Really give nsAutoArrayBase a copy constructor so that nsAutoTArray's implicit copy constructor will use it r=froydnj 2014-02-13 20:47:32 +00:00
Benoit Jacob
fb8f0a8ef9 Bug 960591 - Prevent implicitly constructing nsTArray<E> elements from E* pointers - r=ehsan 2014-01-17 11:54:19 -05:00
Jon Coppeard
49b6cfda81 Bug 939206 - Fix nsTArray post barriers for JS::Heap<T> elements r=bsmedberg 2013-12-07 12:50:28 +00:00
Markus Stange
513b0bcce1 Bug 924103 - Add a FilterDescription data structure and code that can create FilterNodes from it. r=roc 2013-11-27 12:25:28 +01:00
Benjamin Smedberg
9950de3641 Bug 938794 - Annotate OOM size as infallible string or data structures abort, r=froydnj
--HG--
extra : rebase_source : f84278dfbba92c6d75458b525a559b6f8598500f
2013-11-25 15:06:17 -05:00
Ryan VanderMeulen
4864326b61 Backed out changeset 4887ddabba31 (bug 939231) for mochitest hangs.
CLOSED TREE
2013-11-21 09:39:38 -05:00
Ehsan Akhgari
3d3d26fb09 Bug 939231 - Stop requiring trace-malloc for the deadlock detector; r=bent
The existing deadlock detector code uses the trace-malloc stack walking
facilities, which is problematic for a few reasons.

1. It is only available in builds with --enable-trace-malloc, which is
   not in the default build configuration.
2. It tries to capture a symbolicated stack trace every time that a lock
   is acquired or released, which is really slow.

This patch changes the deadlock detector to use the XPCOM stack walking
and symbolification facilities, and avoids the symbolification until the
point where we need to print out the call stack, which makes the
deadlock detector a lot faster than it currently is in trace-malloc
builds.
2013-11-21 07:43:23 -05:00
Nathan Froyd
d390eec815 Bug 929494 - use template typedefs, not inheritance, to define nsTArray element copiers; r=ehsan
There's no reason to use inheritance here, and using plain typedefs avoids massive
amounts of code duplication for the common case of copying with mem*.  Code savings
on Android come in at about 570K (!), or ~2% of libxul .text size, which is a massive
win.
2013-10-22 10:36:34 -04:00
Mats Palmgren
2093e63d6e Bug 911283 - Introduce nsTArray::SetLengthAndRetainStorage which unlike SetLength does not deallocate/reallocate the internal storage. Use it in NS_FillArray. r=bsmedberg 2013-09-08 02:05:02 +00:00
Ms2ger
9d023a67df Bug 904110 - Move alignment features out of Util.h into a new header; r=Waldo 2013-08-14 09:00:52 +02:00
Ehsan Akhgari
2824b29025 Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Paul Adenot
53a2f501c5 Bug 882543 - Retain storage for media streams accross iterations instead of reallocating. r=jlebar,roc 2013-07-19 16:40:56 +02:00
Mike Hommey
d01870f66f Bug 892401 - Remove NEW_H. r=ted 2013-07-12 09:16:41 +09:00
Justin Lebar
3e059c7221 Bug 820686 - Remove code after MOZ_CRASH or MOZ_ASSUME_NOT_REACHED. r=(see below)
r=tbsaunde for accessible
r=jmuizelaar for gfx
r=waldo for js
r=roc for layout
r=glandium for mozglue
r=jduell for netwerk
r=khuey for everything else
2013-06-28 18:38:32 -07:00
Justin Lebar
051c5b560a Bug 802686 - s/MOZ_NOT_REACHED/MOZ_CRASH/ in Gecko. r=(see below)
r=tbsaunde for accessible
r=jmuizelaar for gfx
r=roc for layout
r=glandium for mozglue
r=jduell for netwerk
r=khuey for everything else

This is a mechanical change made with sed.  Later patches in this queue
clean up the whitespace errors and so on.
2013-06-28 18:38:30 -07:00
Catalin Iacob
6f4758d23e Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00
Jon Coppeard
82a8b49403 Bug 877762 - GC: Post-barrier cycle collector participants - 2 Stop nsTArray memmoving Heap<T>s r=jlebar r=bz 2013-06-18 11:00:37 +01:00
Trevor Saunders
369e88fcc0 bug 856790 - make nsTArray::EnsureLengthAtleast() return void r=jlebar 2013-04-01 16:42:54 -04:00
Trevor Saunders
b81241eb2d bug 856696 - make nsTArray::SwapElements() return void r=jlebar 2013-04-01 13:43:34 -04:00
Ehsan Akhgari
bc5d923a5a Bug 853548 - Make nsTArray::SetCapacity and InfallibleTArray::SetCapacity return void; r=jlebar 2013-03-21 15:02:20 -04:00
Justin Lebar
c84199fbeb Bug 844820 - Fix two benign races in nsTArray around sEmptyHdr. a=bz 2013-02-26 11:24:41 -05:00
Boris Zbarsky
e4fca1d362 Bug 618479 part 1. Clean up the nsTArray binary-insert code a little bit. r=jlebar,kinetik 2013-02-13 10:11:53 -05:00
Jeff Walden
39b56d89e1 Rename the |static const bool result| member of IsSame, IsPod, and IsPointer to |value| to be consistent with every other type trait. I have no idea how I managed to consistently not notice this during review. Followup to bug 723228, r=typo 2013-02-08 22:59:54 -08:00
Razvan Cojocaru
c8372e3fae Bug 723228 - nsTArray::AssignRange should use memcpy when possible. r=jlebar for the XPCOM changes, r=jwalden for js/mfbt changes
--HG--
extra : rebase_source : 2442a0d29ae0fa7edd0312d980cbc270a4f33134
2013-02-08 13:18:49 -08:00
Justin Lebar
be3b9d9bca Bug 819791 - Part 11: Make nsTArray and friends' copy constructors explicit. r=bz 2012-12-18 20:16:07 -05:00
Justin Lebar
e73a12f35f Bug 819791 - Part 3: Make typeof nsTArray == typeof InfallibleTArray. r=bz
Also make typeof nsAutoTArray == typeof AutoInfallibleTArray and switch
files to using nsTArrayForwardDeclare.h.
2012-12-18 20:16:06 -05:00
Justin Lebar
3ff706b49a Bug 819791 - Part 1: Remove nsTArrayDefaultAllocator, replacing it unconditionally with nsTArrayInfallibleAllocator. r=bz 2012-12-18 20:16:06 -05:00
Boris Zbarsky
6efc316628 Bug 819523 part 1. Make it possible to use the various-allocator nsTArrays interchangeably as long as you're working with const objects. r=jlebar 2012-12-18 20:16:05 -05:00
Boris Zbarsky
3adcd6d60f Bug 815671 part 10. Make nsTArray constructors explicit. r=jlebar 2012-11-29 11:14:14 -05:00
Benoit Jacob
6d7beedec6 Bug 806279 - CC macros refactoring: part 1: implement type-generic CC UNLINK/TRAVERSE macros - r=mccr8,smaug 2012-11-15 02:32:39 -05:00
William Chen
1e6c1fa4b2 Bug 798065 - Fix integer underflow in nsTArray::LastIndexOf. r=cjones 2012-10-04 15:23:41 -07:00