summaryrefslogtreecommitdiff
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-08-07 08:49:18 -0600
committerTom Rini <trini@konsulko.com>2024-08-07 08:51:25 -0600
commit2078abaf00b63fc4f70f8a599b61a476e22352f3 (patch)
treef8270a7900fa738a48481dae58d659445c6c6827 /common/dlmalloc.c
parent54920df1c57a407626c04786013eb1ecbb3a7fce (diff)
parent75581e419aa2bf5cc1b4c3ec79701017b44d1a66 (diff)
Merge patch series "alist: Implement a pointer list / array of structs"
Simon Glass <sjg@chromium.org> says: This data structure provides a list of pointers / array of structures. I was planning to use it for the lmb restructure, to allow it to support any number of entries, but then I gave up on it. There are quite a few places in U-Boot where such a list would be useful, since it supports growing the array. [...] Example: struct my_struct obj; struct my_struct *ptr = alist_add(&lst, &obj, struct my_struct); // now ptr is in the list [trini: Reword the cover letter slightly, do not merge the RFC portion]
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 62e8557daa7..1e1602a24de 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1698,6 +1698,10 @@ Void_t* rEALLOc_impl(oldmem, bytes) Void_t* oldmem; size_t bytes;
panic("pre-reloc realloc() is not supported");
}
#endif
+ if (CONFIG_IS_ENABLED(UNIT_TEST) && malloc_testing) {
+ if (--malloc_max_allocs < 0)
+ return NULL;
+ }
newp = oldp = mem2chunk(oldmem);
newsize = oldsize = chunksize(oldp);