From 62d638386c17d17b929ad10956c7f60825335a4e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 6 Sep 2022 20:27:00 -0600 Subject: test: Support testing malloc() failures It is helpful to test that out-of-memory checks work correctly in code that calls malloc(). Add a simple way to force failure after a given number of malloc() calls. Fix a header guard to avoid a build error on sandbox_vpl. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- arch/sandbox/include/asm/malloc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sandbox/include/asm/malloc.h') diff --git a/arch/sandbox/include/asm/malloc.h b/arch/sandbox/include/asm/malloc.h index a1467b5eadd..8aaaa9cb87b 100644 --- a/arch/sandbox/include/asm/malloc.h +++ b/arch/sandbox/include/asm/malloc.h @@ -6,6 +6,7 @@ */ #ifndef __ASM_MALLOC_H +#define __ASM_MALLOC_H void *malloc(size_t size); void free(void *ptr); -- cgit v1.2.3