Skip to content

Commit 7b0a0c8

Browse files
committed
1 parent dc8fe13 commit 7b0a0c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cores/esp8266/umm_malloc/umm_malloc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,11 +1409,11 @@ static void _umm_free( void *ptr ) {
14091409

14101410
c = (((char *)ptr)-(char *)(&(umm_heap[0])))/sizeof(umm_block);
14111411

1412+
DBG_LOG_DEBUG( "Freeing block %6d\n", c );
1413+
14121414
/* Protect the critical section... */
14131415
UMM_CRITICAL_ENTRY(id_free);
14141416

1415-
DBG_LOG_DEBUG( "Freeing block %6d\n", c );
1416-
14171417
/* Update dynamic Free Block count */
14181418
ummHeapFreeBlocks += (UMM_NBLOCK(c) - c);
14191419

@@ -1591,13 +1591,13 @@ static void *_umm_malloc( size_t size ) {
15911591
ummHeapFreeBlocks -= blocks;
15921592

15931593
} else {
1594+
/* Release the critical section... */
1595+
UMM_CRITICAL_EXIT(id_malloc);
1596+
15941597
/* Out of memory */
15951598

15961599
DBG_LOG_DEBUG( "Can't allocate %5d blocks\n", blocks );
15971600

1598-
/* Release the critical section... */
1599-
UMM_CRITICAL_EXIT(id_malloc);
1600-
16011601
return( (void *)NULL );
16021602
}
16031603

0 commit comments

Comments
 (0)