Skip to content

Commit 7768a8c

Browse files
committed
py/malloc: Put { on separate line for funcs that have selective sigs.
To ensure there are balanced {}'s in the file, and to help with formatting.
1 parent 73670ef commit 7768a8c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

py/malloc.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,11 @@ void *m_malloc0(size_t num_bytes) {
133133
}
134134

135135
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
136-
void *m_realloc(void *ptr, size_t old_num_bytes, size_t new_num_bytes) {
136+
void *m_realloc(void *ptr, size_t old_num_bytes, size_t new_num_bytes)
137137
#else
138-
void *m_realloc(void *ptr, size_t new_num_bytes) {
138+
void *m_realloc(void *ptr, size_t new_num_bytes)
139139
#endif
140+
{
140141
void *new_ptr = realloc(ptr, new_num_bytes);
141142
if (new_ptr == NULL && new_num_bytes != 0) {
142143
m_malloc_fail(new_num_bytes);
@@ -161,10 +162,11 @@ void *m_realloc(void *ptr, size_t new_num_bytes) {
161162
}
162163

163164
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
164-
void *m_realloc_maybe(void *ptr, size_t old_num_bytes, size_t new_num_bytes, bool allow_move) {
165+
void *m_realloc_maybe(void *ptr, size_t old_num_bytes, size_t new_num_bytes, bool allow_move)
165166
#else
166-
void *m_realloc_maybe(void *ptr, size_t new_num_bytes, bool allow_move) {
167+
void *m_realloc_maybe(void *ptr, size_t new_num_bytes, bool allow_move)
167168
#endif
169+
{
168170
void *new_ptr = realloc_ext(ptr, new_num_bytes, allow_move);
169171
#if MICROPY_MEM_STATS
170172
// At first thought, "Total bytes allocated" should only grow,
@@ -189,10 +191,11 @@ void *m_realloc_maybe(void *ptr, size_t new_num_bytes, bool allow_move) {
189191
}
190192

191193
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
192-
void m_free(void *ptr, size_t num_bytes) {
194+
void m_free(void *ptr, size_t num_bytes)
193195
#else
194-
void m_free(void *ptr) {
196+
void m_free(void *ptr)
195197
#endif
198+
{
196199
free(ptr);
197200
#if MICROPY_MEM_STATS
198201
MP_STATE_MEM(current_bytes_allocated) -= num_bytes;

0 commit comments

Comments
 (0)