From 3fb246b7757b5966bf54b9e07ef059478bc46ff3 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Fri, 26 Apr 2024 23:31:20 +0100 Subject: [PATCH] Utilise magic memory tree interface for src/lists.c --- src/lists.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lists.c b/src/lists.c index 6d3595c2..6b3469c7 100644 --- a/src/lists.c +++ b/src/lists.c @@ -40,19 +40,15 @@ #include #include +#include "avrdude.h" #include "libavrdude.h" #define MAGIC 0xb05b05b0 #define CHECK_MAGIC 0 /* set to 1 to enable memory overwrite detection */ -#ifdef BOS -#define MALLOC(size,x) kmalloc(size,x) -#define FREE kfree -#else -#define MALLOC(size,x) malloc(size) -#define FREE free -#endif +#define MALLOC(size,x) mmt_malloc(size) +#define FREE mmt_free /*------------------------------------------------------------ @@ -397,13 +393,13 @@ free_listnode ( LIST * l, LISTNODE * ln ) If liststruct is not NULL, it is used to provide the memory space for the list structure instance, otherwise, the necessary memory is - malloc'd. + mmt_malloc'd. If elements is zero, the default poolsize is used, otherwise, - poolsizes of 'elements' elements are malloc'd to obtain the memory + poolsizes of 'elements' elements are mmt_malloc'd to obtain the memory for list nodes. Minimum element count is 5. - The first node pool is not preallocated; instead it is malloc'd at + The first node pool is not preallocated; instead it is mmt_malloc'd at the time of the first use. ----------------------------------------------------------------------*/ LISTID