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.
This commit is contained in:
Damien George 2020-02-27 12:34:05 +11:00
parent 73670ef281
commit 7768a8c38d
1 changed files with 9 additions and 6 deletions

View File

@ -133,10 +133,11 @@ void *m_malloc0(size_t num_bytes) {
}
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
void *m_realloc(void *ptr, size_t old_num_bytes, size_t new_num_bytes) {
void *m_realloc(void *ptr, size_t old_num_bytes, size_t new_num_bytes)
#else
void *m_realloc(void *ptr, size_t new_num_bytes) {
void *m_realloc(void *ptr, size_t new_num_bytes)
#endif
{
void *new_ptr = realloc(ptr, new_num_bytes);
if (new_ptr == NULL && new_num_bytes != 0) {
m_malloc_fail(new_num_bytes);
@ -161,10 +162,11 @@ void *m_realloc(void *ptr, size_t new_num_bytes) {
}
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
void *m_realloc_maybe(void *ptr, size_t old_num_bytes, size_t new_num_bytes, bool allow_move) {
void *m_realloc_maybe(void *ptr, size_t old_num_bytes, size_t new_num_bytes, bool allow_move)
#else
void *m_realloc_maybe(void *ptr, size_t new_num_bytes, bool allow_move) {
void *m_realloc_maybe(void *ptr, size_t new_num_bytes, bool allow_move)
#endif
{
void *new_ptr = realloc_ext(ptr, new_num_bytes, allow_move);
#if MICROPY_MEM_STATS
// 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) {
}
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
void m_free(void *ptr, size_t num_bytes) {
void m_free(void *ptr, size_t num_bytes)
#else
void m_free(void *ptr) {
void m_free(void *ptr)
#endif
{
free(ptr);
#if MICROPY_MEM_STATS
MP_STATE_MEM(current_bytes_allocated) -= num_bytes;