Commit graph

316 commits

Author SHA1 Message Date
Hans Boehm
12f788e763 Merge "Fix SharedBuffer. Remove aref." am: 069517574e
am: 1e081a8c5f

* commit '1e081a8c5f2d6e6cb55658bb289db1f0b4f5774a':
  Fix SharedBuffer. Remove aref.

Change-Id: I5849137bb49d727d1c1d245f0f61d11c4ee10859
2016-05-23 22:22:18 +00:00
Hans Boehm
3e4c076ef2 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
2016-05-23 17:28:52 +00:00
Hans Boehm
fdad5af164 Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" am: 62212954ef
am: d657e639cf

* commit 'd657e639cf74e0ee5a32d0f67efe0097c3df17a1':
  Fix memory order and race bugs in Refbase.h & RefBase.cpp

Change-Id: I79106bb0399e7699d51d526235843504ab52708b
2016-05-19 22:12:01 +00:00
Hans Boehm
62212954ef Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" 2016-05-19 22:01:41 +00:00
Hans Boehm
e263e6c633 Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
2016-05-17 16:11:11 -07:00
Michael Wright
30a1db7045 Merge "Fix strstr16." into nyc-dev
am: a34a383607

* commit 'a34a383607007d632878929c6c9278221242d457':
  Fix strstr16.

Change-Id: I8fa1fab977f974c861cecb8b24b72cd175c27752
2016-05-17 17:28:02 +00:00
Michael Wright
0fd60eb9b4 Fix strstr16.
strcmp needs a limit, otherwise it will compare the null terminator
with the next character in the haystack, which results in the compare
failing for all searches except where the needle is found at the very
end.

Bug: 28663748
Change-Id: I1939dc4037c2f2a75d617943b063d2d38a8c5e3a
2016-05-16 21:23:07 +01:00
Greg Hackmann
1e18e78601 Merge "SystemClock: elapsedRealtimeNano() should use clock_gettime() on Linux" am: e3ff256228
am: 6d28bd81f5

* commit '6d28bd81f55236d1a82f00f8ac568ad61a03128d':
  SystemClock: elapsedRealtimeNano() should use clock_gettime() on Linux

Change-Id: Id5ecad63fb6cd79cc7db641d992e9525bc2b8779
2016-05-16 18:23:42 +00:00
Greg Hackmann
8f9a6372f6 Merge "SystemClock: add test" am: 282e8fb037
am: a91a1a990f

* commit 'a91a1a990f1d629377dcd2c3f2b57ccab48dc8cf':
  SystemClock: add test

Change-Id: I547a4c3422eb468530e3cdd02eb2bb157a444a15
2016-05-16 18:23:41 +00:00
Treehugger Robot
e3ff256228 Merge "SystemClock: elapsedRealtimeNano() should use clock_gettime() on Linux" 2016-05-16 18:18:57 +00:00
Treehugger Robot
282e8fb037 Merge "SystemClock: add test" 2016-05-16 18:18:30 +00:00
Michael Wright
2a9a993af9 Merge commit '8b452b876b90dcfff1dab9012b65b5e67c4531a4' into manual_merge_8b452b8
Change-Id: Iacdc2d521f669661b4979c03b0476512abdb37c7
2016-05-16 15:06:22 +01:00
Michael Wright
5bacef33c9 Add String16#contains and strstr16 methods.
These are needed for aapt to find javadoc comments that contain
"@removed" in order to skip them when printing styleable docs.

Bug: 28663748
Change-Id: I8866d2167c41e11d6c2586da369560d5815fd13e
2016-05-09 19:45:07 +01:00
Greg Hackmann
e94c92cd48 SystemClock: elapsedRealtimeNano() should use clock_gettime() on Linux
We've removed the Android alarm driver from our supported kernels.
clock_gettime(CLOCK_BOOTTIME) has been a viable option since 2.6.39, so
there's no need for the legacy code path anymore.

We can use this on Linux hosts too, since no one should be building
Android on hosts with kernels that old.

Bug: 28357356

Change-Id: I0aa164383c95e77c53d2c85883d83f85d4abc7b1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-05-02 14:00:02 -07:00
Greg Hackmann
340079df26 SystemClock: add test
Bug: 28357356

Change-Id: Idf66c048bda09cd8cb08adf89ed0edd3770c4e39
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-05-02 13:59:58 -07:00
Chih-hung Hsieh
fb44ca5178 Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

* commit '427d8d840f6ec5ce5767b2ee521e4ac5b7ebd619':
  Fix google-explicit-constructor warnings.

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
2016-04-30 05:16:35 +00:00
Chih-Hung Hsieh
1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -07:00
Elliott Hughes
7b2d2d6afa Merge "Remove debugging code for a fixed 3.6 kernel bug." am: af61acc
am: 058fd2e

* commit '058fd2edbcea9a6d224a3473fe8fdcb2f7735d37':
  Remove debugging code for a fixed 3.6 kernel bug.

Change-Id: I40ce05d262ab8e718fff4df8df7a41d2d6923e05
2016-04-09 00:31:32 +00:00
Elliott Hughes
ad19af7132 Remove debugging code for a fixed 3.6 kernel bug.
Change-Id: If17d41d6151cd7b81677afc5d341d7aa788170e4
2016-04-04 16:06:53 -07:00
Brian Carlstrom
de6d6041c1 system/core: Make Thread::run threadName argument required
am: e71b914775

* commit 'e71b9147756ab4da306e4c16461ad23936769603':
  system/core: Make Thread::run threadName argument required
2016-03-14 15:24:54 +00:00
Brian Carlstrom
e71b914775 system/core: Make Thread::run threadName argument required
Bug: 27557176
Change-Id: Iae83a1e5489c86c2858fc8481f246b8480f0eec4
2016-03-12 21:32:52 -08:00
George Burgess IV
02f689e11a Merge "Cleanup uses of sprintf so we can deprecate it." am: 2c5b89a64a
am: 3368bdebba

* commit '3368bdebba02316710bafc5bce120eec388365fb':
  Cleanup uses of sprintf so we can deprecate it.
2016-03-08 07:41:39 +00:00
George Burgess IV
e7aa2b2c83 Cleanup uses of sprintf so we can deprecate it.
Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.

Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
2016-03-07 18:40:40 -08:00
James Hawkins
650ba8b8d6 Merge "system/core/lib[c]utils: Fix signedness comparison warnings." am: bba2151b29
am: 65df16b05f

* commit '65df16b05f8d590e1fccc19e9a28833d6a71567d':
  system/core/lib[c]utils: Fix signedness comparison warnings.
2016-03-01 20:32:09 +00:00
James Hawkins
b898075f30 system/core/lib[c]utils: Fix signedness comparison warnings.
* Store the output of a length variable in size_t.
* Annotate unsigned constant values as such.

Bug: 27384813
Change-Id: I8504c0a8f5840d4d42e5c0df797a4e5d02d13eb9
2016-03-01 11:21:53 -08:00
Dan Willemsen
9dddd137c7 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718

(cherry picked from commit 86cf941c48)

Change-Id: I8d39d1951fea1b3011caf585c983e1da7959f7c0
2016-02-25 18:43:55 -08:00
Dimitry Ivanov
ca0c8ce614 Merge "Make libutils symbols protected" into nyc-dev
am: aa2cf3facf

* commit 'aa2cf3facf8d26a3642c90cbf5b83e18934da48c':
  Make libutils symbols protected
2016-02-25 21:10:24 +00:00
Dimitry Ivanov
96ccb85fa2 Make libutils symbols protected
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.

Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
(cherry picked from commit 2c7960c8d9)
2016-02-25 13:09:40 -08:00
Dimitry Ivanov
2c7960c8d9 Make libutils symbols protected
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.

Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
2016-02-25 11:44:35 -08:00
James Hawkins
22b6f7a559 resolve merge conflicts of 0f5d443d0c to nyc-dev-plus-aosp
Change-Id: I850bda0808ae17ade5bc0e667211a599d284d6e3
2016-02-19 11:10:30 -08:00
James Hawkins
bd04bb0d29 Merge "system/core: Cleanup direct calls to opendir by containing in a std::unique_ptr." 2016-02-19 17:49:13 +00:00
Samuel Tan
cf1649da00 Merge "libutils: add String8 and String16 std_string utility methods" am: fb0670d650
am: 941d48f0ee

* commit '941d48f0eeb98fac7c869beee22833ff659318bc':
  libutils: add String8 and String16 std_string utility methods
2016-02-19 04:49:17 +00:00
Samuel Tan
4b2e76966e Merge "libutils: remove whitespace from String8 files" am: e771e846a8
am: 450b9b7068

* commit '450b9b7068cac286ca442c404a90a8a8b57a79e8':
  libutils: remove whitespace from String8 files
2016-02-19 04:49:08 +00:00
Samuel Tan
9ac4e005b4 libutils: add String8 and String16 std_string utility methods
Add utility methods that convert String16 and String8 into
std::string.

Also, remove a repeated include of <utils/Unicode.h> in
String16.h, since it is not used in that header file,
and is already included in String16.cpp.

BUG: 27200800
Change-Id: I5238aeb70689499763060a99dff9950fbb7adb3e
TEST: libutils builds successfully.
2016-02-18 17:04:23 -08:00
Samuel Tan
95fd527065 libutils: remove whitespace from String8 files
Remove trailing whitespace from String8 header and
cpp files.

BUG: None
Change-Id: Ie77da3f0fbce9cdce20225ce1310cf62295179a4
2016-02-18 17:04:20 -08:00
James Hawkins
588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
Samuel Tan
9518b9db5b Merge "libutils: remove whitespaces in String16.cpp and String16.h"
am: 8c09555aac

* commit '8c09555aac6f00cb7fa7d62cb5c356e2f07a268b':
  libutils: remove whitespaces in String16.cpp and String16.h
2016-02-17 00:38:10 +00:00
Samuel Tan
f9d16ef106 libutils: remove whitespaces in String16.cpp and String16.h
Remove trailing whitespaces in both these files.

BUG: None
Change-Id: I18eca5162871b5b2bf7757a7ef36a4e80073798c
2016-02-16 15:21:34 -08:00
Dan Willemsen
cf1381c834 Merge "Fix windows 64-bit builds"
am: 3f68ba4dc6

* commit '3f68ba4dc67360d4c242110005e36bfe65c66098':
  Fix windows 64-bit builds
2016-02-08 23:59:59 +00:00
Dan Willemsen
86cf941c48 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718
Change-Id: I4e43e7cf18a96f22b3a9a08dbab8c3e960c12930
2016-02-05 16:10:10 -08:00
Nick Kralevich
261952e570 Merge "more O_CLOEXEC" am: 920d637d25
am: 890cd99709

* commit '890cd997098795b7a58c1d56c49c23895da7b4f9':
  more O_CLOEXEC
2015-12-18 23:05:34 -08:00
Nick Kralevich
c68c8862f9 more O_CLOEXEC
Change-Id: I330aef8d6f1fc35d6649995ef312954b84dff555
2015-12-18 20:57:25 -08:00
Sergio Giro
43f13d0d68 Merge "libutils: fix cache removal when callback invalidates the key" am: b0df9dca7c am: e483305e47
am: a96cd36afb

* commit 'a96cd36afbff682e24365092dd85bbe9c9165afc':
  libutils: fix cache removal when callback invalidates the key
2015-11-20 17:17:38 +00:00
Sergio Giro
b7170fe3fe libutils: fix cache removal when callback invalidates the key
Bug: 24785286
Change-Id: I9d17d2247258a56ef7776b3a701389e825a9c533
2015-11-20 14:54:51 +00:00
Dan Albert
8f3ef3fd09 Merge "Use std::unique_ptr instead of UniquePtr." am: 0f61f86870 am: 0c69e9f271
am: 40f76c2fed

* commit '40f76c2fedb18664adab73e40b8b64227601d4e6':
  Use std::unique_ptr instead of UniquePtr.
2015-11-05 21:11:03 +00:00
Dan Albert
f2d2509690 Use std::unique_ptr instead of UniquePtr.
Bug: http://b/22403888
Change-Id: I398fa43b8f33c9281d7ff238521d75f1dcb8a5e7
2015-11-05 01:09:22 -08:00
John Reck
dc7694eac5 Merge "Teach sp<> how to std::move" am: 518d043c86 am: bb12b91ae1
am: a573d6b186

* commit 'a573d6b18686266667c8efd9d7291ecd28efa67c':
  Teach sp<> how to std::move
2015-11-03 00:14:15 +00:00
John Reck
bb12b91ae1 Merge "Teach sp<> how to std::move"
am: 518d043c86

* commit '518d043c8693835061b02ecbbee4b82fc61a776e':
  Teach sp<> how to std::move
2015-11-02 21:39:24 +00:00
John Reck
d69089a742 Teach sp<> how to std::move
Arguably we should migrate to std::shared_ptr
but for now make std::vector<sp<>> a bit less
horrible

Change-Id: Ia458a2daff0b656b2f3310b3ea100565ec844c69
2015-10-29 07:17:40 -07:00
Andy Hung
6db2d260b2 Merge "Disable sanitization for LinearTransform" am: c52b3c08fa am: 0d3b144372
am: eb1adff81e

* commit 'eb1adff81e8d7752248c42c4dcb525ec085853e1':
  Disable sanitization for LinearTransform
2015-10-22 19:50:52 +00:00
Andy Hung
0d3b144372 Merge "Disable sanitization for LinearTransform"
am: c52b3c08fa

* commit 'c52b3c08fa5ea3680ffcd68c2a1d0542d09f0509':
  Disable sanitization for LinearTransform
2015-10-22 19:46:20 +00:00
Andy Hung
13c19e7703 Disable sanitization for LinearTransform
Avoids potential crash on Fugu.

Bug: 25160007
Change-Id: I2e883539e36204821f3eb97f0ae4a4854014f048
2015-10-22 11:20:45 -07:00
Sergio Giro
d155004e78 am 51209a8b: am 9443fd94: am f8376607: Merge "system/core: fix iterator for LruCache"
* commit '51209a8b93d85f8b7f3b6a106c41c1aa03190f2c':
  system/core: fix iterator for LruCache
2015-10-13 07:45:36 +00:00
Sergio Giro
9443fd94e3 am f8376607: Merge "system/core: fix iterator for LruCache"
* commit 'f83766079e248e04065103a4720364c0193777ee':
  system/core: fix iterator for LruCache
2015-10-13 07:36:52 +00:00
Sergio Giro
0cb59c0dce system/core: fix iterator for LruCache
Was failing to return the first element

Change-Id: Ic803f5d463a56519212014d0d190407cf4b859cf
2015-10-12 16:13:44 +01:00
Adam Lesinski
7e59e17474 am 0b2bce06: am bda375fa: am c6c6ab50: Merge "Implement C++11 move semantics for android::FileMap"
* commit '0b2bce06382b5517a4dba33da5328c751f2c7a3e':
  Implement C++11 move semantics for android::FileMap
2015-10-02 01:31:53 +00:00
Adam Lesinski
0b2bce0638 am bda375fa: am c6c6ab50: Merge "Implement C++11 move semantics for android::FileMap"
* commit 'bda375fa41c88e6b2f81a8cd88fc5fdda62bc723':
  Implement C++11 move semantics for android::FileMap
2015-10-02 01:25:31 +00:00
Adam Lesinski
bda375fa41 am c6c6ab50: Merge "Implement C++11 move semantics for android::FileMap"
* commit 'c6c6ab50bc11d55f3135312ceccbcf0c400b437e':
  Implement C++11 move semantics for android::FileMap
2015-10-02 01:19:25 +00:00
Sergio Giro
a5f71e075a system/core: remove BasicHashtable
Towards deprecation of SharedBuffer

Change-Id: Id6d1c8637583df38b6f28398b6804d9c1e96472a
(cherry picked from commit f84a4906fa)
2015-10-01 13:18:13 -07:00
Adam Lesinski
6f8885bc14 Implement C++11 move semantics for android::FileMap
FileMaps should be movable, thereby not requiring them to be only used
with a unique_ptr as they currently are.

Change-Id: I0fb8013bf398a2ced5420d85ba888c2a7fc5a496
2015-10-01 12:47:49 -07:00
Sergio Giro
3412280cbc resolved conflicts for 075f690d to master
Change-Id: I35b870a1e43b9a4b9f09ecabee68c54f993b036f
2015-10-01 20:21:56 +01:00
Sergio Giro
075f690dae am bdae9bf2: resolved conflicts for 70808827 to stage-aosp-master
* commit 'bdae9bf2ec3bbf8e33a34caa412bd8fd7bc2d434':
  system/core: remove BasicHashtable
2015-10-01 18:59:59 +00:00
Sergio Giro
bdae9bf2ec resolved conflicts for 70808827 to stage-aosp-master
Change-Id: I2de8a63fa5be5423846df4c2e8ccc5f12e843f09
2015-10-01 19:49:22 +01:00
Sergio Giro
45dd164bff Revert "resolved conflicts for 70808827 to stage-aosp-master"
This reverts commit 5cf2d5c9cc.

Change-Id: Ifcffff034d4610c0d318cf67b0d98a28551c9605
2015-10-01 18:33:25 +00:00
Sergio Giro
5cf2d5c9cc resolved conflicts for 70808827 to stage-aosp-master
Change-Id: I5e5030a20f2be3bd15b9fec8192dd22ec5a34d87
2015-10-01 18:54:33 +01:00
Sergio Giro
f84a4906fa system/core: remove BasicHashtable
Towards deprecation of SharedBuffer

Change-Id: Id6d1c8637583df38b6f28398b6804d9c1e96472a
2015-10-01 11:44:47 +01:00
Sergio Giro
58a25053c6 am c559a9b5: am b5a00d6b: am e0453334: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
* commit 'c559a9b52fe79c5be32121f8f82c672a5eac94ef':
  system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:20:21 +00:00
Sergio Giro
c559a9b52f am b5a00d6b: am e0453334: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
* commit 'b5a00d6b2e9a386701cf9f3f5997837496a5aa57':
  system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:11:38 +00:00
Sergio Giro
b5a00d6b2e am e0453334: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
* commit 'e045333445ab3ebb8d602d25ed750169f135baa6':
  system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:04:50 +00:00
Sergio Giro
0e7fb13d57 libutils: fix compile error in SharedBufferTest
Change-Id: Ib1185d417457d03efa102989a64b5b5e4eb5c82a
2015-09-30 10:44:17 -07:00
Sergio Giro
e045333445 Merge "system/core: remove methods returning SharedBuffer in String8, String16" 2015-09-30 15:21:48 +00:00
Sergio Giro
282efae9c3 system/core: remove methods returning SharedBuffer in String8, String16
Towards deprecation of SharedBuffer

Change-Id: I3069837db32837bcc0f5d8f1118ccd502c9070dc
2015-09-30 15:42:02 +01:00
Sergio Giro
9428978318 am fbb259e8: am 8e2c8208: am 730fdbb1: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
* commit 'fbb259e83633c35c5e6ede1d5f55f5672ab433d0':
  system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:31:45 +00:00
Sergio Giro
fbb259e836 am 8e2c8208: am 730fdbb1: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
* commit '8e2c8208198c1c73c7192b1bd5e87868b53297c6':
  system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:26:23 +00:00
Sergio Giro
8e2c820819 am 730fdbb1: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
* commit '730fdbb1ca4c39a4d69868f7a261b023f2bea296':
  system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:20:02 +00:00
Sergio Giro
bb58cde899 system/core: change LruCache to use unordered_set instead of BasicHashTable
Towards deprecation of BasicHashTable

Change-Id: I3f3d904636a85a794cccf972f6e4a94e7f3808f5
2015-09-30 13:48:30 +01:00
Sergio Giro
21ca798137 resolved conflicts for 8dba9a7b to master
Change-Id: I314e3fc4dffbff1f7030533a821696692d03b33d
2015-09-23 22:03:30 +01:00
Sergio Giro
8dba9a7bf1 libutils: fix compile error in SharedBufferTest
Change-Id: Ib1185d417457d03efa102989a64b5b5e4eb5c82a
2015-09-23 21:22:14 +01:00
Sergio Giro
fa2f9d603c am c565bdb6: am f777655d: resolved conflicts for 6ee734cf to stage-aosp-master
* commit 'c565bdb67b801fe2b4965b44e53dccfd9097993c':
  libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
2015-09-23 19:50:33 +00:00
Sergio Giro
c565bdb67b am f777655d: resolved conflicts for 6ee734cf to stage-aosp-master
* commit 'f777655d85af3aefa4a1683f289da1ec67988330':
  libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
2015-09-23 17:15:12 +00:00
Sergio Giro
f777655d85 resolved conflicts for 6ee734cf to stage-aosp-master
Change-Id: Ia06c4d941d9b8828707299bb363f51fab5549897
2015-09-23 17:58:25 +01:00
Sergio Giro
d2529f2830 libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
Some methods in header files of classes using SharedBuffer need
to be moved to the implementation files accordingly

Change-Id: I891f3ace2b940ab219e4e449040bfed71c0547db
2015-09-23 16:22:59 +01:00
Brian Carlstrom
7ae1d6590b am 16bed965: am 742d0173: am 661600dd: am 110f705e: resolved conflicts for 832a0d1c to mnc-dev
* commit '16bed9650aa493194b4091700ac81c9c882d96b2':
  libutils: Fix integer overflows in VectorImpl.
2015-09-20 01:25:14 +00:00
Brian Carlstrom
16bed9650a am 742d0173: am 661600dd: am 110f705e: resolved conflicts for 832a0d1c to mnc-dev
* commit '742d0173e8bd41e137d175c04860c532270b3f5b':
  libutils: Fix integer overflows in VectorImpl.
2015-09-20 01:21:47 +00:00
Brian Carlstrom
110f705e10 resolved conflicts for 832a0d1c to mnc-dev
Change-Id: Ic46ee60de7bc500f4e1d5fe841524db80918a8d9
2015-09-19 17:29:42 -07:00
Brian Carlstrom
832a0d1c64 resolved conflicts for cf676a86 to lmp-mr1-ub-dev
Change-Id: Ifd9a44777a472ae893f894391bff7ef81456d92c
2015-09-19 16:13:00 -07:00
Narayan Kamath
419e6c3c68 libutils: Fix integer overflows in VectorImpl.
Use external/safe-iop to check for overflows on arithmetic
operations.

Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.

Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.

bug: 22953624

(cherry picked from commit c609c31fb5)

Change-Id: I61644633db6b54fa230683615de9724f7fabf6fb
2015-09-09 12:05:06 +01:00
Narayan Kamath
69b9a8bf21 am 51e740f8: resolved conflicts for 32d86587 to mnc-dr-dev-plus-aosp
* commit '51e740f802083cc250a2f6228222bcbbcec79887':
  libutils: Fix integer overflows in VectorImpl.
2015-09-08 13:07:52 +00:00
Narayan Kamath
51e740f802 resolved conflicts for 32d86587 to mnc-dr-dev-plus-aosp
Change-Id: I381133e7dd93f908bd3d2b42e8af83d954e428af
2015-09-08 13:59:49 +01:00
Sergio Giro
df5151d30f libutils: add test for String8
Test crashes with SIGSEGV without the fix in b/23290056, passes otherwise.

Bug: 23290056
Change-Id: I6daca0aa07b5e97b004a9606a0227227fae11896
2015-09-07 17:12:45 +01:00
Dan Willemsen
c91a974e2e am 54afdbae: am a4b8f9f1: am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit '54afdbaef79c7265395d0b84f54c96c7c9f11322':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 02:25:35 +00:00
Dan Willemsen
a4b8f9f1c2 am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Narayan Kamath
c609c31fb5 libutils: Fix integer overflows in VectorImpl.
Use external/safe-iop to check for overflows on arithmetic
operations.

Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.

Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.

bug: 22953624

Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
2015-09-02 12:37:49 +01:00
Nick Kralevich
63e5142283 am 6b86f3fe: am 5e44f5cc: am 2c58af52: Merge "VectorImpl.cpp: fix benign multiplication overflow"
* commit '6b86f3fe304c7aa4f2c629a1cacd84428aad9a3e':
  VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:46:51 +00:00
Nick Kralevich
5e44f5cc0c am 2c58af52: Merge "VectorImpl.cpp: fix benign multiplication overflow"
* commit '2c58af52232f0c8b4ab09d75eba66d1283805cab':
  VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:28:37 +00:00
Nick Kralevich
c76698f24e VectorImpl.cpp: fix benign multiplication overflow
j is a ssize_t, which can go negative. If it goes negative,
the resulting multiplication of mItemSize*j doesn't make
any sense. Since the value is never used, just don't perform
the calculation if j < 0.

Bug: 23607865
Change-Id: I14f6f6506645d582f7d67a2e2d60ead3cb18b957
2015-08-28 06:40:23 -07:00
Abhishek Arya
09f2d36e1d am 5b33306d: Merge "libutils: fix overflow in SharedBuffer [DO NOT MERGE]" into mnc-dev
* commit '5b33306dba456ec906f7c9bd522681c1de137f78':
  libutils: fix overflow in SharedBuffer [DO NOT MERGE]
2015-08-26 20:12:44 +00:00
Bart Sears
170bde83ae resolved conflicts for merge of 7c327194 to lmp-mr1-ub-dev
Change-Id: I236367bd60046ba06669cbcdae81184f9d0a74c7
2015-08-26 12:59:28 -07:00
Sergio Giro
d95e47f136 libutils: fix overflow in SharedBuffer [DO NOT MERGE]
See
https://code.google.com/p/android/issues/detail?id=181910

Bug: 22952485
(cherry picked from commit 66b6eb9490)

Change-Id: I363f49b5b3c6b7b3ac08cba2c14d72c431588c5a
2015-08-25 17:40:47 +01:00