heap_tlsf: use tlsf IMPL in ESP32C2 ROM

This commit is contained in:
jiangguangming
2021-03-19 17:29:42 +08:00
committed by wuzhenghui
parent a9f8b20431
commit 6ec373daf5
11 changed files with 95 additions and 36 deletions

View File

@@ -1,16 +1,8 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -29,6 +21,8 @@
/* Defines compile-time configuration macros */
#include "multi_heap_config.h"
#include "heap_tlsf.h"
#ifdef MULTI_HEAP_POISONING
/* Alias MULTI_HEAP_POISONING_SLOW to SLOW for better readabilty */
@@ -339,6 +333,9 @@ multi_heap_handle_t multi_heap_register(void *start, size_t size)
if (start != NULL) {
memset(start, FREE_FILL_PATTERN, size);
}
#endif
#ifdef CONFIG_HEAP_ROM_IMPL
tlsf_poison_fill_pfunc_set(multi_heap_internal_poison_fill_region);
#endif
return multi_heap_register_impl(start, size);
}