mfunyu / malloc

Find out the workings behind optimum memory management and recode it, as well as free and realloc.
2 stars 0 forks source link

[crush] cruch on print_heap #52

Closed mfunyu closed 5 months ago

mfunyu commented 5 months ago
$> make bonus
$> LD_PRELOAD=./libft_malloc.so MallocDebug=1 MallocShowAbbr=1 gcc  
 0x7f7043cf83a8   ||           0x7f704a583000 | bk
------------------++--------------------------+
 0x7f7043cf83b0   || e/en/LC_                 | 
                  || [    101424 (  0x18c30)] |
==================++==========================+
 0x7f7043d10fe0   ||                  0x18c50 | prev_size
------------------++--------------------------+
 0x7f7043d10fe8   ||       -8 (      0x0) |A|-| size
------------------++--------------------------+
 0x7f7043d10ff0   ||           0x7f704a583000 | fd
==================++==========================+

TINY: 0x7f704a583000 ~ 0x7f704a59d000 (106496 bytes)
==================++==========================+
 0x7f704a583008   ||     1048 (    0x420) |-|P| size
------------------++--------------------------+
                  || (( abbriviated ))        | 
==================++==========================+
 0x7f704a583420   ||                    0x420 | prev_size
------------------++--------------------------+
 0x7f704a583428   ||       88 (     0x60) |A|-| size
------------------++--------------------------+
 0x7f704a583430   ||           0x7f704a583570 | fd
==================++==========================+

TINY: 0x7f704a583570 ~ 0x7f704a59d570 (106496 bytes)
==================++==========================+
 0x7f704a583570   ||       0x54552e53555f6e65 | prev_size
------------------++--------------------------+
 0x7f704a583578   ||  3681592 ( 0x382d40) |A|-| size
------------------++--------------------------+
 0x7f704a583580   ||                          | mem
==================++==========================+
[1]    113306 segmentation fault (core dumped)  LD_PRELOAD=./libft_malloc.so MallocDebug=1 MallocShowAbbr=1 gcc                       
mfunyu commented 5 months ago
mfunyu commented 5 months ago