u-boot/test/lib
Simon Glass 67bc59df05 Add support for an owned buffer
When passing a data buffer back from a function, it is not always clear
who owns the buffer, i.e. who is responsible for freeing the memory used.
An example of this is where multiple files are decompressed from the
firmware image, using a temporary buffer for reading (since the
compressed data has to live somewhere) and producing a temporary or
permanent buffer with the resuilts.

Where the firmware image can be memory-mapped, as on x86, the compressed
data does not need to be buffered, but the complexity of having a buffer
which is either allocated or not, makes the code hard to understand.

Introduce a new 'abuf' which supports simple buffer operations:

- encapsulating a buffer and its size
- either allocated with malloc() or not
- able to be reliably freed if necessary
- able to be converted to an allocated buffer if needed

This simple API makes it easier to deal with allocated and memory-mapped
buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-10-08 15:53:26 -04:00
..
abuf.c Add support for an owned buffer 2021-10-08 15:53:26 -04:00
asn1.c lib/crypto, efi_loader: move some headers to include/crypto 2020-05-04 12:26:11 +02:00
cmd_ut_lib.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
efi_device_path.c test: unit test for efi_dp_check_length() 2020-08-24 16:37:53 +02:00
efi_image_region.c test: provide tests for efi_image_region_add() 2020-07-03 18:03:41 +02:00
getopt.c test: Add a test for getopt 2020-10-30 10:56:11 -04:00
hexdump.c test: call hexdump tests via ut lib 2019-04-22 18:13:21 -04:00
lmb.c test: lmb: add test for lmb_reserve_flags 2021-06-07 10:48:40 -04:00
longjmp.c test: unit test for longjmp 2021-04-08 15:37:29 +08:00
Makefile Add support for an owned buffer 2021-10-08 15:53:26 -04:00
rsa.c test: add rsa_verify() unit test 2020-03-12 08:20:39 -04:00
sscanf.c lib: sscanf: add sscanf implementation 2020-08-14 15:18:30 -04:00
string.c lib: Add memdup() 2021-10-08 15:53:26 -04:00
strlcat.c test: Fix size_t formats in strlcat test 2021-07-27 10:34:27 +09:00
test_aes.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
test_crypt.c lib: wrap crypt API to hide errno usage 2021-07-23 13:36:20 -04:00
test_errno_str.c test: provide test for errno_str() 2019-10-31 07:22:53 -04:00
test_print.c test: Silenece the echo and print tests 2021-03-27 15:04:31 +13:00