Skip to content

Commit

Permalink
rust, 智能指针转裸指针故意不回收, 无限循环, 直接跟他爆了!
Browse files Browse the repository at this point in the history
  • Loading branch information
DrEden33773 committed Feb 10, 2024
1 parent 459c539 commit b1c7521
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DrEden33773/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

An extremely short executable rust implementation to f**k the memory up.
An extremely short executable rust implementation to f\*\*k the memory up.

## Code

Expand All @@ -15,5 +15,4 @@ fn main(){loop{Box::leak(0.into());}}
1. `0.into()` simply generates a unique pointer with a clean ownership
2. `Box::leak()` simply forgets the input unique pointer's ownership, turning it into a raw pointer
3. Each time you leak a unique pointer, you don't give a try to free/drop it's load on heap memory
4. `loop{}` means this program will continue to be executed until all of the memory have been f**ked up

4. `loop{}` means this program will continue to be executed until all of the memory have been f\*\*ked up

0 comments on commit b1c7521

Please sign in to comment.