forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10027 from eightycc/issue-9837
Resolve RP2 Network Performance Issue
- Loading branch information
Showing
6 changed files
with
112 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2025 Bob Abeles | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <stddef.h> | ||
|
||
void *lwip_heap_malloc(size_t size); | ||
void lwip_heap_free(void *ptr); | ||
void *lwip_heap_calloc(size_t num, size_t size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This file is part of the CircuitPython project: https://circuitpython.org | ||
// | ||
// SPDX-FileCopyrightText: Copyright (c) 2025 Bob Abeles | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include <stdint.h> | ||
#include <string.h> | ||
#include "lib/tlsf/tlsf.h" | ||
#include "lwip_mem.h" | ||
#include "supervisor/port_heap.h" | ||
|
||
void *lwip_heap_malloc(size_t size) { | ||
return port_malloc(size, true); | ||
} | ||
|
||
void lwip_heap_free(void *ptr) { | ||
port_free(ptr); | ||
} | ||
|
||
void *lwip_heap_calloc(size_t num, size_t size) { | ||
void *ptr = lwip_heap_malloc(num * size); | ||
if (ptr != NULL) { | ||
memset(ptr, 0, num * size); | ||
} | ||
return ptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters