<feed xmlns='http://www.w3.org/2005/Atom'>
<title>replicant/core/libutils/FileMap.cpp, branch replicant-9</title>
<subtitle>Patches not merged yet, used for building and testing them
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/'/>
<entry>
<title>Fix uninitialized member variable</title>
<updated>2017-05-11T17:30:52+00:00</updated>
<author>
<name>Renaud Paquay</name>
<email>rpaquay@google.com</email>
</author>
<published>2017-05-11T00:48:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=b7a4f0b9e2779fbddc675641c5a2978168f0df2f'/>
<id>b7a4f0b9e2779fbddc675641c5a2978168f0df2f</id>
<content type='text'>
The default constructor of FileMap was missing an initializer for the
mFileMapping variables. This results in CloseHandle being called with
a "random" value, which can cause havoc in Win32 process over time (e.g.
in the case of libaapt2_jni.dll, which is loaded in a JVM process).

Also, update the code to use "NULL" for invalid file map handle
and "INVALID_HANDLE_VALUE" for invalid file handle.

Bug: 38197857
Test: Stress testing on (Windows) machine
Change-Id: Ibd769219d601fbafcfcee89e848b31cc5137826c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The default constructor of FileMap was missing an initializer for the
mFileMapping variables. This results in CloseHandle being called with
a "random" value, which can cause havoc in Win32 process over time (e.g.
in the case of libaapt2_jni.dll, which is loaded in a JVM process).

Also, update the code to use "NULL" for invalid file map handle
and "INVALID_HANDLE_VALUE" for invalid file handle.

Bug: 38197857
Test: Stress testing on (Windows) machine
Change-Id: Ibd769219d601fbafcfcee89e848b31cc5137826c
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix warnings in libutils headers</title>
<updated>2016-09-22T20:03:15+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2016-09-16T01:15:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=17b5b82d64686d482e6dcf96ee54fd62234d5f27'/>
<id>17b5b82d64686d482e6dcf96ee54fd62234d5f27</id>
<content type='text'>
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in libutils
headers in preparation for moving from -isystem to -I.

- Fix implicit cast from int64_t to long in Condition.h.  Remove
  the __LP64__ check and always compare against LONG_MAX before
  casting.
- Fix implicit cast from size_t to ssize_t in KeyedVector.h
- Fix -Wshadow-field-in-constructor warnings in Looper.h and RefBase.h
- Move destructors for MessageHandler and LooperCallback to Looper.cpp
  and ReferenceRenamer and VirtualLightRefBase to RefBase.cpp to prevent
  vtables in every compilation unit.
- Declare template variables in Singleton.h
- Fix old-style casts in StrongPointer.h and TypeHelpers.h
- Use template metaprogramming in TypeHelpers.h to avoid warnings on
  memmove on non-trivial types.
- Add an assignment operator to key_value_pair_t to complete
  rule-of-three
- Use memcpy instead of dereferencing a reinterpret_casted pointer to
  treat the bits of a float or double as int32_t or int64_t
- Escape unicode sequences inside doxygen comments between \code and
  \endcode
- Remove WIN32 ZD definition in Compat.h, %zd works fine with mingw
- Fix WIN32 printf warnings in Filemap.cpp
- Initialize mNullValue with 0 in LruCache.h, some of the tests use a
  non-pointer type for TValue.

Test: m -j native
Bug: 31492149
Change-Id: I385a05a3ca01258e44fe3b37ef77e4aaff547b26
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in libutils
headers in preparation for moving from -isystem to -I.

- Fix implicit cast from int64_t to long in Condition.h.  Remove
  the __LP64__ check and always compare against LONG_MAX before
  casting.
- Fix implicit cast from size_t to ssize_t in KeyedVector.h
- Fix -Wshadow-field-in-constructor warnings in Looper.h and RefBase.h
- Move destructors for MessageHandler and LooperCallback to Looper.cpp
  and ReferenceRenamer and VirtualLightRefBase to RefBase.cpp to prevent
  vtables in every compilation unit.
- Declare template variables in Singleton.h
- Fix old-style casts in StrongPointer.h and TypeHelpers.h
- Use template metaprogramming in TypeHelpers.h to avoid warnings on
  memmove on non-trivial types.
- Add an assignment operator to key_value_pair_t to complete
  rule-of-three
- Use memcpy instead of dereferencing a reinterpret_casted pointer to
  treat the bits of a float or double as int32_t or int64_t
- Escape unicode sequences inside doxygen comments between \code and
  \endcode
- Remove WIN32 ZD definition in Compat.h, %zd works fine with mingw
- Fix WIN32 printf warnings in Filemap.cpp
- Initialize mNullValue with 0 in LruCache.h, some of the tests use a
  non-pointer type for TValue.

Test: m -j native
Bug: 31492149
Change-Id: I385a05a3ca01258e44fe3b37ef77e4aaff547b26
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement C++11 move semantics for android::FileMap</title>
<updated>2015-10-01T19:47:49+00:00</updated>
<author>
<name>Adam Lesinski</name>
<email>adamlesinski@google.com</email>
</author>
<published>2015-09-23T01:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=6f8885bc143460d77f300a981169e0487ff923c1'/>
<id>6f8885bc143460d77f300a981169e0487ff923c1</id>
<content type='text'>
FileMaps should be movable, thereby not requiring them to be only used
with a unique_ptr as they currently are.

Change-Id: I0fb8013bf398a2ced5420d85ba888c2a7fc5a496
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FileMaps should be movable, thereby not requiring them to be only used
with a unique_ptr as they currently are.

Change-Id: I0fb8013bf398a2ced5420d85ba888c2a7fc5a496
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove useless refCounting from FileMap.</title>
<updated>2015-02-23T15:49:43+00:00</updated>
<author>
<name>Narayan Kamath</name>
<email>narayan@google.com</email>
</author>
<published>2015-02-23T15:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=6832a7a4e04c84192f0bafc6ac990fc79cd13882'/>
<id>6832a7a4e04c84192f0bafc6ac990fc79cd13882</id>
<content type='text'>
Nobody ever called acquire() so release() was always
equivalent to delete. Just use delete instead so that
people can use unique_ptr directly (or shared_ptr if
they really want refcounts).

Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nobody ever called acquire() so release() was always
equivalent to delete. Just use delete instead so that
people can use unique_ptr directly (or shared_ptr if
they really want refcounts).

Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove reference to NOT_USING_KLIBC and cygwin.</title>
<updated>2015-02-19T18:36:27+00:00</updated>
<author>
<name>Narayan Kamath</name>
<email>narayan@google.com</email>
</author>
<published>2015-02-19T17:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=5955a9f5e4dee9fdcad113943771e8f9a2138748'/>
<id>5955a9f5e4dee9fdcad113943771e8f9a2138748</id>
<content type='text'>
The reference to NOT_USING_KLIBC appears to be the only one
in our codebase. This change also removes some cygwin specific
retry logic - all other supported platforms in this section
of the code should support mapping at an offset.

Note that i've reversed the sense of the check, we always sysconf
since that's recommended practice.

Change-Id: Ib985fb665193d7a07a282f7092cd77c0bc508a66
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The reference to NOT_USING_KLIBC appears to be the only one
in our codebase. This change also removes some cygwin specific
retry logic - all other supported platforms in this section
of the code should support mapping at an offset.

Note that i've reversed the sense of the check, we always sysconf
since that's recommended practice.

Change-Id: Ib985fb665193d7a07a282f7092cd77c0bc508a66
</pre>
</div>
</content>
</entry>
<entry>
<title>kill HAVE_MADVISE</title>
<updated>2014-11-19T04:03:27+00:00</updated>
<author>
<name>Yabin Cui</name>
<email>yabinc@google.com</email>
</author>
<published>2014-11-19T04:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=745c5f6ad01ece07b0163d0b5869994bceb26b1a'/>
<id>745c5f6ad01ece07b0163d0b5869994bceb26b1a</id>
<content type='text'>
Change to avoid "unused parameter" warning. 

Bug: 18397020
Change-Id: I4b26de55314c78237daead8e873385b97cafe4d4</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change to avoid "unused parameter" warning. 

Bug: 18397020
Change-Id: I4b26de55314c78237daead8e873385b97cafe4d4</pre>
</div>
</content>
</entry>
<entry>
<title>kill HAVE_MADVISE</title>
<updated>2014-11-19T02:15:40+00:00</updated>
<author>
<name>Yabin Cui</name>
<email>yabinc@google.com</email>
</author>
<published>2014-11-19T02:15:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=819b480b935a99fc8114b622644f42dec9e3a177'/>
<id>819b480b935a99fc8114b622644f42dec9e3a177</id>
<content type='text'>
Bug: 18397020
Change-Id: Ibc8d886d729c51932a403531888214de4e541452
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 18397020
Change-Id: Ibc8d886d729c51932a403531888214de4e541452
</pre>
</div>
</content>
</entry>
<entry>
<title>kill HAVE_POSIX_FILEMAP</title>
<updated>2014-11-11T18:31:30+00:00</updated>
<author>
<name>Yabin Cui</name>
<email>yabinc@google.com</email>
</author>
<published>2014-11-11T18:31:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=266092c52dea85daaa14c671c1a2f133330f0ed8'/>
<id>266092c52dea85daaa14c671c1a2f133330f0ed8</id>
<content type='text'>
Bug: 18315579
Change-Id: I0bd5fb946b12cb90e0c9c73a478df41609b8c3e2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 18315579
Change-Id: I0bd5fb946b12cb90e0c9c73a478df41609b8c3e2
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix windows specific behavior of FileMap</title>
<updated>2014-10-16T19:09:06+00:00</updated>
<author>
<name>Xavier Ducrohet</name>
<email>xav@google.com</email>
</author>
<published>2014-10-16T17:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=1a55aa5e34f201b060da9a84ec9702401f05be18'/>
<id>1a55aa5e34f201b060da9a84ec9702401f05be18</id>
<content type='text'>
The implementation of the FileMap destructor would
close the file, only on Windows, which did not match
the behavior on mac/linux.

This is because calling munmap does not close the file
descriptor. It must be closed separately, before or after
munmap.

On Windows, the file must also be closed manually,
before or after closing the mappingFile.

The change basically removes the closing file from
the windows-specific part of the destructor, to
make behavior more consistent on all platforms
where the caller to FileMap is responsible for closing
its own file (since FileMap receives an opened file).

Change-Id: I5e3cfffbb870d5f3595802ccac57dbc1dbf1ce6e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implementation of the FileMap destructor would
close the file, only on Windows, which did not match
the behavior on mac/linux.

This is because calling munmap does not close the file
descriptor. It must be closed separately, before or after
munmap.

On Windows, the file must also be closed manually,
before or after closing the mappingFile.

The change basically removes the closing file from
the windows-specific part of the destructor, to
make behavior more consistent on all platforms
where the caller to FileMap is responsible for closing
its own file (since FileMap receives an opened file).

Change-Id: I5e3cfffbb870d5f3595802ccac57dbc1dbf1ce6e
</pre>
</div>
</content>
</entry>
<entry>
<title>libutils: turn on -Werror</title>
<updated>2014-06-02T22:57:50+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2014-04-30T18:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=5bed8036644f552210a7cfcbed2d6d20cf2981b0'/>
<id>5bed8036644f552210a7cfcbed2d6d20cf2981b0</id>
<content type='text'>
- Deal with some -Wunused issues
- Override PRI macros (windows)
- Revert use of PRI macros on off64_t (linux)
- Deal with a gnu++11 complaince issue

Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Deal with some -Wunused issues
- Override PRI macros (windows)
- Revert use of PRI macros on off64_t (linux)
- Deal with a gnu++11 complaince issue

Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
</pre>
</div>
</content>
</entry>
</feed>
