summaryrefslogtreecommitdiff
path: root/libsparse/sparse.cpp
Commit message (Collapse)AuthorAgeFilesLines
* libsparse: Fix overflow of merged sparse chunk lengthHyeongseok Kim2020-08-111-4/+4
| | | | | | | | | | | | Merging sparse chunk can make sparse map block bigger than 4GiB, that can't be covered by unsigned integer type. Fix this by changing unsigned int to uint64_t type. Test: sparse build Bug: 162808120 Change-Id: Id4d3f88f9d531c25c3937c99b2c81efb915605ee Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com> Cc: hyeongseok.kim <hyeongseok.kim@lge.com>
* libsparse: Limit block size to 64 MBWoody Lin2020-06-031-0/+12
| | | | | | | | Limit the block size to 64 MB before fastboot executable binary for windows 64-bit is released. Bug: 156057250 Change-Id: Ic4edb963a3d99f718d7630aba3f351729a84e994
* Fix an unintialized return value.Stephen Hines2019-05-021-1/+1
| | | | | | Bug: http://b/131390872 Test: Built aosp_blueline successfully. Change-Id: Iea5255be280dfc089a95fc25a0f988e913c18679
* Revert "libsparse: Add sparse typed callback"Tobias Thierer2018-07-261-30/+7
| | | | | | | | | | | | | | | | | | | This reverts commit db69f0d47f3ccb3ff656c56fe2b68aaf5ab853f6. Reason for revert: Broke the build: In file included from system/core/libsparse/sparse.cpp:26: system/core/libsparse/output_file.h:34:72: error: unknown type name 'off64_t'; did you mean 'off_t'? int (*skip_write)(void*, off64_t), void* priv, ^~~~~~~ off_t /Applications/Xcode6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/_types/_off_t.h:30:25: note: 'off_t' declared here typedef __darwin_off_t off_t; ^ 1 error generated. Bug: 78793464 Change-Id: I0f8bc4e9aa2f74612bfd8721d00d961e3f7e695f
* libsparse: Add sparse typed callbackJerry Zhang2018-07-251-7/+30
| | | | | | | | | | | | | | | | Currently, sparse_file_callback uses libsparse's own logic for reading a file into a buffer. However, a caller may want to use their own logic for doing this in order to customize the buffer size and parallelize the reads/writes. Also, a caller may want to implement fill blocks with their own logic as well. To do this add sparse_file_typed_callback which calls a different callback function depending on the type of the sparse chunk being written. Test: Use typed callback for fd writes Bug: 78793464 Change-Id: I75955a464fc05991f806339830fdfa05fda354b9
* [libsparse] Modernize codebase by replacing NULL with nullptrYi Kong2018-07-231-7/+7
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I43dae734817cae7a260ffc7afcd85fbd4451eddf
* libsparse: Add .clang-format and reformat to google3 styleJerry Zhang2018-06-131-297/+250
| | | | | | Bug: 78793464 Test: compiles Change-Id: I8e44ba77195a12fc2bac7d4276bbc4aa95149b31
* libsparse: Change source files to cppJerry Zhang2018-06-131-0/+395
Bug: 78793464 Test: compiles Change-Id: Ib8b933fe3ccb8dfa49a77f7955891678bf0df086