Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° Memory Wallet

Your RAM is your wallet. Your allocations are your money. Your pointers are your receipts.

Instead of treating malloc() and free() like abstract low-level calls, you can think of memory like a wallet:

  • alloc = reserve money in a block
  • free = return a block to the wallet
  • memory = check what is currently reserved
  • leaks = see what is still active

Under the hood, the C engine does the real work with malloc() and free(), while the Python CLI gives you a simple wallet-style interface using Rich.

Quick Start

gcc -shared -fPIC memory.c -o libmemory.so
python3 cli.py

Concept

πŸ’° Allocation = reserving money in a block

🧾 Pointer = receipt used to find it again

πŸ’Έ Free = return the money

πŸ’€ Memory leak = money still reserved, but the receipt is lost

Example

wallet> alloc 64
πŸ’° You received 64 bytes
🏦 Block created
πŸ“ Address: 0x55c5726f4780

wallet> free 0x55c5726f4780

πŸ—‘οΈ Block returned

wallet> leaks

πŸ’š No memory leaks

About

Your RAM is your wallet πŸ’° Simple C + Python lab to learn malloc/free (and πŸ’€πŸ’΅ leaks).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages