bootutil: Only include <os/malloc.h> if it going to be used

When no dynamic memory is used, there is no need for include "os/malloc.h",
and do so will force the user to create an empty "os/malloc.h" file.

Signed-off-by: Carlos Falgueras García <carlos.falgueras@wslw.es>
This commit is contained in:
Carlos Falgueras García 2021-06-21 16:58:07 +02:00 committed by David Brown
parent 8787bb04ae
commit 391b19781e
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,6 @@
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <os/os_malloc.h>
#include "bootutil/bootutil.h"
#include "bootutil/image.h"
#include "bootutil_priv.h"
@ -50,6 +49,10 @@
#include "bootutil/enc_key.h"
#endif
#if !defined(MCUBOOT_DIRECT_XIP) && !defined(MCUBOOT_RAM_LOAD)
#include <os/os_malloc.h>
#endif
#include "mcuboot_config/mcuboot_config.h"
BOOT_LOG_MODULE_DECLARE(mcuboot);