Commit Graph

461 Commits

Author SHA1 Message Date
Michael Wright
24beb02a7a Added bitwise-or and bitwise-and to BitSet
Change-Id: I9bbf41f9d2d4a2593b0e6d7d8be7e283f985bade
2013-05-30 18:40:04 -07:00
Nick Kralevich
06a582e8b5 Remove unnecessary header file.
In b2cac4ff37, the last
reference to property_get was removed, but the include
file remained. Remove it.

This is causing me unrelated problems.

Change-Id: I87bbfbfa5871f6da4a1b00037a225f67bbd75881
2013-05-17 11:06:39 -07:00
Mathias Agopian
a6cb0397da remove reserved virtual slots
these consume small amount of space (plt) in every library that
links against libutils.

Change-Id: I1b6b3dd9098aa5a051243f7a5dbf91cd7dcb8b2c
2013-05-09 14:57:05 -07:00
Mathias Agopian
8050299f5b new String8, String16 ctors to initialize empty static strings with static linkage
when libutils is statically linked, the ordering of the static
initializer is not guaranteed and therefore it's unsafe to use
empty static strings: e.g.:

static String8 sThisStaticStringIsNotSafe;

instead, this new constructor can be used:

static String8 sThisStaticStringIsSafe(kEmptyString);

Change-Id: Ia3daf1cab1c97d021c0ee9c2b394b5e27e8d6c0d
2013-05-08 18:13:07 -07:00
Mathias Agopian
002e1e58df libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
2013-05-07 18:28:11 -07:00
Todd Poynor
b4f1a027cb Merge "String8: ensure static init done prior to empty string reference" 2013-05-07 23:30:22 +00:00
Dianne Hackborn
ffad7d1fdc Add new Looper API to check whether the looper is idle.
This is just to support the watchdog to give it a faster
way to determine if a thread is deadlocked without having
to post a message to it.

Change-Id: I068dc8b9387caf94fe5811fb4aeb0f9b57b1a080
2013-05-07 15:05:34 -07:00
Todd Poynor
1bf3b4a06d String8: ensure static init done prior to empty string reference
Avoid NULL deref on static initialization of empty String8 objects prior
to libutils static init.

Change-Id: I3d420041ba62b97ed8c2dfd2532a2dcd72b84ff1
2013-05-07 12:09:46 -07:00
Bjorn Bringert
f19c4ae816 Build a static device libutils
This is needed to make tools such as aapt more compatible when
built for the device.

Change-Id: I1261d47b6e24595f1be547b9202892863f66a1de
2013-04-26 15:12:47 +01:00
Mathias Agopian
2342085d3c am dbbf209e: am 7133f863: Merge "improved CallStack a bit" into jb-mr2-dev
* commit 'dbbf209e66947b7c1f52d90558873ed3ec0591d7':
  improved CallStack a bit
2013-03-22 04:34:32 +00:00
Mathias Agopian
cab25d680e improved CallStack a bit
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
2013-03-21 17:12:40 -07:00
Mathias Agopian
d5db7a1826 am 656a6780: am 9cd766a5: disable RefBase consistency checks (NDEBUG)
* commit '656a6780b5714c8667f604d7925729325d1cbcef':
  disable RefBase consistency checks (NDEBUG)
2013-03-20 00:54:41 +00:00
Mathias Agopian
3adfa01354 am dd3fcd2e: am 4e37ddff: Fix a crasher with RefBase debugging and vectors of wp<>
* commit 'dd3fcd2e583f5aff7ef390442fe4ed6395d4cc4c':
  Fix a crasher with RefBase debugging and vectors of wp<>
2013-03-20 00:54:41 +00:00
Mathias Agopian
9cd766a517 disable RefBase consistency checks (NDEBUG)
Bug: 8328715
Change-Id: Ib57646ff909fd8744610f37f3b50d90d884dff31
2013-03-19 17:36:57 -07:00
Mathias Agopian
4e37ddff43 Fix a crasher with RefBase debugging and vectors of wp<>
background:
we have some code to fix-up the IDs of references when
using RefBase's DEBUG_REFS when those refs are managed by
arrays wp<> or sp<> (this is because wp<> / sp<> don't have
a trivial ctor when DEBUG_REFS is enabled, and Vector
treats them as trivial for obvious performance reasons)

this is complicated by the fact that we don't want to have
to recompile everything when enabling DEBUG_REFs (i.e.: the
Vector code cannot know wheter it's enabled or not for its
template stuff).

problem:
there was a bug in the fix-up code for wp<> which was trying
to access the weakref_impl from the RefBase* however, this was
moronic since RefBase could have been destroyed if there wasn't
any more strong refs -- and this happned. Instead we need to get
the weakref_impl directly from the wp<>

Change-Id: Ie16e334204205fdbff142acb9faff8479a78450b
2013-03-19 16:41:56 -07:00
Mathias Agopian
0095ee53ad am 364a1f95: am ca987c87: Merge "A few tweaks to RefBase debugging" into jb-mr2-dev
* commit '364a1f95786746118d62c90279aa3dd8eb93db8d':
  A few tweaks to RefBase debugging
2013-03-19 23:06:06 +00:00
Mathias Agopian
19437cb84c A few tweaks to RefBase debugging
- stacks are now saved in /data/debug which must be
  created and writable by the user.

- removed "always fatal" DEBUG_REFS option, it wasn't
  really needed.

- DEBUG_REFS_ENABLED_BY_DEFAULT is not the default anymore
  (usually people want to target which refs they're tracking)

Change-Id: I37fae72e9dacde6ce1fa8f7dbe2bc01b1a1b95e5
2013-03-18 22:59:40 -07:00
Jesse Hall
647a92aa69 am df608eb1: am ce7e2781: Merge "Add Vector::resize()" into jb-mr2-dev
* commit 'df608eb15d3b90d2e71e07baaa6de423c29769c8':
  Add Vector::resize()
2013-03-17 16:27:56 +00:00
Jesse Hall
e81421e1cb Add Vector::resize()
Bug: 8384764
Change-Id: Icee83d389f3e555eba7d419b64c8d52a9aa21b8b
2013-03-15 12:40:39 -07:00
Dianne Hackborn
470378f3c0 am 5f72d05a: am 1791eefd: fix a couple race-conditions in RefBase::promote()
* commit '5f72d05a01d9b7a1bd6d2a2a269b80facd206066':
  fix a couple race-conditions in RefBase::promote()
2013-03-15 04:35:16 +00:00
Dianne Hackborn
1791eefd69 fix a couple race-conditions in RefBase::promote()
Bug: 8390295
Change-Id: I7a48e3bf5b213cc1da2b8e844c6bb37ee24cb047
2013-03-14 16:47:41 -07:00
Mathias Agopian
21dd0236e8 am 9ac559b5: am f795852b: temporary: enable ASSERTs in RefBase
* commit '9ac559b58c49a43ed9468422feef0ae500340efe':
  temporary: enable ASSERTs in RefBase
2013-03-12 04:36:53 +00:00
Mathias Agopian
f795852b54 temporary: enable ASSERTs in RefBase
this is in an attempt to get more data on
bug 8328715.

Change-Id: I9333a67c2d7f67f4d9b2fc5eb1ad8a7b2d1c6dcb
2013-03-11 21:27:16 -07:00
Romain Guy
47e83a14d0 am c75412dc: am dbca4a0e: Merge "Add Thread::isRunning and Condition::signal(WakeUpType)" into jb-mr2-dev
* commit 'c75412dcdd617423a033e4a647f43b35af1fc0c4':
  Add Thread::isRunning and Condition::signal(WakeUpType)
2013-03-11 21:41:18 +00:00
Romain Guy
dbca4a0ee5 Merge "Add Thread::isRunning and Condition::signal(WakeUpType)" into jb-mr2-dev 2013-03-11 21:38:26 +00:00
Romain Guy
9447be65c3 Add Thread::isRunning and Condition::signal(WakeUpType)
The signal() method is useful to choose whether to wake up one or
all threads.

Change-Id: I062ab6d3ddd306a9fb735549ea140e2a76eed75a
2013-03-11 14:34:56 -07:00
Mathias Agopian
336dda6b93 am 3f27f950: am 6b2b7009: Merge changes Ibb3b6ff0,I2341e20c into jb-mr2-dev
* commit '3f27f9503356f8f60246dd188c4dd899e8999150':
  rename binder services main thread to Binder_*
  limit number of extra binder threads in SF to 4
2013-03-08 20:31:57 +00:00
Mathias Agopian
e3e43b384e rename binder services main thread to Binder_*
When a binder service's main thread joins the thread pool
it retains its name (whatever the exec name was), which is
very confusing in systrace.

we now rename that thread just like its friends in the
thread pool.

Change-Id: Ibb3b6ff07304b247cfc6fb1694e72350c579513e
2013-03-07 15:34:28 -08:00
Mathias Agopian
e8e7c46ae5 am 483fbb3b: am 1f758231: Merge changes I7f696e42,I51c6df3c into jb-mr2-dev
* commit '483fbb3befcfc5d113cf5931cbf32e59a99c21c6':
  Make GraphicBuffer a RefBase
  Fix RefBase debugging. O_CREAT must specify the mode.
2013-03-07 17:34:33 +00:00
Mathias Agopian
dbf146f1d6 Fix RefBase debugging. O_CREAT must specify the mode.
Change-Id: I51c6df3cfd59b20ca73c3edee86bc2f74dbde1b1
2013-03-06 17:52:34 -08:00
Glenn Kasten
03cacfd29b Merge "Continue removing property debug.sys.noschedgroups" 2013-03-05 23:37:49 +00:00
Nick Kralevich
c4fd05b172 Revert "try to fix win_sdk build."
A better change was checked into system/core. See commit
941daef629bd571032851edf7ae1dce24266640e

This reverts commit fa99d30ec7.
2013-02-02 18:09:15 -08:00
Nick Kralevich
fa99d30ec7 try to fix win_sdk build.
Change-Id: I55e78e339874a6d6a3381c2550556b65c7ec1ca0
2013-02-01 16:09:23 -08:00
Marco Nelissen
32130635f6 Add NULL check to CallStack::toString
CallStack::toString() has a 0 default argument, which ends up getting
passed to strlen(), resulting in a crash.

Change-Id: If706aff8c400983670f49cdbb66e11191ac76e0e
2012-12-17 10:28:20 -08:00
Chris Craik
0a73f822b1 Add LinearAllocator
Moving from external/webkit/Source/WebCore/platform/graphics/android/utils/

Change-Id: If91830aa9b207dbc8692b2ca7c4a0b76778addd5
2012-12-05 17:34:54 -08:00
Alex Ray
653078f652 utils: clarify scoped tracing functionality
ScopedTrace objects were being used in place of ATRACE_NAME because of a
misunderstanding of it's function.  Cleared up documentation for usage.

Also explicitly use global namespace for sysprop callback.

Change-Id: I7c248b486b614ccdb841659ca0dcfc644fda670a
2012-11-30 19:54:00 -08:00
Alex Ray
b7e06477f0 utils: Use cutils tracing functionality.
Tracing functionality has moved to cutils.

Change-Id: Ie78ccc1d59dd5178f5058fbc3858a37f9adce552
2012-11-29 13:33:14 -08:00
Andy McFadden
2bdd8fd65a am 41f7736a: am 434e21bf: am 3fdeb48e: Reduce emulator logspam
* commit '41f7736ad1e72df8796416a82ce3cede6193d1eb':
  Reduce emulator logspam
2012-11-09 22:49:18 -08:00
Andy McFadden
41f7736ad1 am 434e21bf: am 3fdeb48e: Reduce emulator logspam
* commit '434e21bfd6b14f8d99b9bcdb829e7252edd574f3':
  Reduce emulator logspam
2012-11-09 22:45:13 -08:00
Andy McFadden
3fdeb48e3c Reduce emulator logspam
The emulator doesn't support systrace, but we should point that out
at most once per process.

Bug 7436352

Change-Id: I06b2c1ea0df6c02c11cd2496423c337f8d7c62a1
2012-11-08 16:40:11 -08:00
Raph Levien
3bc7b27571 Merge "Add an LRU cache plus hashing primitives" 2012-10-29 08:59:54 -07:00
Raph Levien
8185e47822 Add an LRU cache plus hashing primitives
This patch adds a hashtable-based LRU cache. This should be
significantly higher performance than the GenerationCache it is intended
to replace. It is a large part of the fix for bug 7271109
TextLayoutCache low-level performance issues.

We added a new method to BasicHashtable to detect when rehashing is
needed, because the internal linked list pointers would get invalidated
by that rehashing.

Also, the hash_type specialized to pointers had a small flaw.

Change-Id: I950c2083f96519777b851dbe157100e0a334caec
2012-10-26 16:09:22 -07:00
Glenn Kasten
b2cac4ff37 Continue removing property debug.sys.noschedgroups
Also 0 means gettid() for get_sched_policy() and set_sched_policy().

Change-Id: Ic12edc3df6c9b3e99eae5cffaf9f6fe56cf14043
2012-10-26 13:24:35 -07:00
Dave Burke
296cd1cb9a am 04075569: Revert "Revert "put back the unused virtuals in Vector<>""
* commit '04075569b565c949a6db8b4e8a9f10d281de4d9c':
  Revert "Revert "put back the unused virtuals in Vector<>""
2012-10-25 11:45:41 -07:00
Dave Burke
04075569b5 Revert "Revert "put back the unused virtuals in Vector<>""
This reverts commit 225c66a48c

Change-Id: If31a04b81052cbc7dd7bf237c07107c33066d03d
2012-10-25 11:40:51 -07:00
Kenny Root
3fe50abbfd am 125becee: am 7abbbc68: Merge "Add TEMP_FAILURE_RETRY to ZipUtils"
* commit '125beceefd44f6abd17ff336bb989e1850965bd8':
  Add TEMP_FAILURE_RETRY to ZipUtils
2012-10-16 16:29:17 -07:00
Kenny Root
d611117f24 Add TEMP_FAILURE_RETRY to ZipUtils
Change-Id: I275c415f14eeffaf9a58d45f3ea014d766441ec3
2012-10-16 14:00:56 -07:00
Kenny Root
e2e95c8ccb am 9bdaa60b: Merge "Add TEMP_FAILURE_RETRY around open and write calls" into jb-mr1-dev
* commit '9bdaa60b809b223d14619d1f13afdd38acb1738d':
  Add TEMP_FAILURE_RETRY around open and write calls
2012-10-12 23:43:29 -07:00
Kenny Root
3de9cd2029 Add TEMP_FAILURE_RETRY around open and write calls
Bug: 7330849
Change-Id: I9aef3c3d3a248c3eea7ca060124ad6decaa6b4da
2012-10-12 11:37:58 -07:00
Kenny Root
7011d5a46b am ee42072b: am 52f1edb3: Merge "Update tests for new build target"
* commit 'ee42072bcccab880dd685736a32a56ac62ffc331':
  Update tests for new build target
2012-10-02 09:55:49 -07:00