summaryrefslogtreecommitdiff
path: root/libsparse/sparse.cpp
AgeCommit message (Collapse)Author
2020-08-11libsparse: Fix overflow of merged sparse chunk lengthHyeongseok Kim
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>
2020-06-03libsparse: Limit block size to 64 MBWoody Lin
Limit the block size to 64 MB before fastboot executable binary for windows 64-bit is released. Bug: 156057250 Change-Id: Ic4edb963a3d99f718d7630aba3f351729a84e994
2019-05-02Fix an unintialized return value.Stephen Hines
Bug: http://b/131390872 Test: Built aosp_blueline successfully. Change-Id: Iea5255be280dfc089a95fc25a0f988e913c18679
2018-07-26Revert "libsparse: Add sparse typed callback"Tobias Thierer
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
2018-07-25libsparse: Add sparse typed callbackJerry Zhang
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
2018-07-23[libsparse] Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I43dae734817cae7a260ffc7afcd85fbd4451eddf
2018-06-13libsparse: Add .clang-format and reformat to google3 styleJerry Zhang
Bug: 78793464 Test: compiles Change-Id: I8e44ba77195a12fc2bac7d4276bbc4aa95149b31
2018-06-13libsparse: Change source files to cppJerry Zhang
Bug: 78793464 Test: compiles Change-Id: Ib8b933fe3ccb8dfa49a77f7955891678bf0df086