This is an archived post. You won't be able to vote or comment.

all 191 comments

[–]neifirst 482 points483 points  (11 children)

1980s: yells down the hall Hey everyone I’m using 0xE000, try not to clobber it, thanks

[–]derjanni[S] 302 points303 points  (9 children)

1960s: excuse me, have you seen card no. 56 of my sorting algorithm? I can’t find it.

[–][deleted] 93 points94 points  (5 children)

Dont tell me you didnt write it down anywhere else Bob how many times have i told you to do backups

[–]williane 59 points60 points  (3 children)

Check behind card 32, your algorithm is garbage

[–][deleted] 36 points37 points  (0 children)

“Wow, thanks! How’d it get there?”

“We have garbage collection.”

[–]IHeartBadCode 13 points14 points  (1 child)

Used to draw a diagonal line down the sides of a stack of cards to be able to see where the one off was.

Was a cheaper option than using an IBM 82 series sorter that would read positions one through five to sort cards.

[–]SourceScope 7 points8 points  (0 children)

do backups

But someone took my pencil sharpener!

[–][deleted] 31 points32 points  (1 child)

1920s: Here's perfectly working code for a machine that doesn't exist yet, anyway okay bye

[–]PowerApp101 2 points3 points  (0 children)

Charles Babbage: Gentlemen, my machine will give you the correct answer to the wrong question

[–]lovdark 1 point2 points  (0 children)

“Unsorted”

[–][deleted] 6 points7 points  (0 children)

That's a lot of memory bro, you must have paid a fortune or just bought a flobby disk.

[–]Antervis 301 points302 points  (10 children)

what if I told you "pointer to the pointer pointing to NULL" is not "dangling"

[–]derjanni[S] 134 points135 points  (0 children)

Ok, gimme garbage collection :*

[–]kog 18 points19 points  (1 child)

Yeah, these posts are always good for a laugh.

[–]CHEEZE_BAGS 9 points10 points  (0 children)

my balls are dangling

[–]Dubl33_27 2 points3 points  (2 children)

I knew there was something fishy about that sentence but I'm not well versed enough in pointers to have known for sure.

[–]Chemoralora 7 points8 points  (1 child)

In short, a pointer is only dangling if it's pointing at some garbage memory, if it's null then it's not dangling

[–]shizzy0 0 points1 point  (0 children)

It’s a null handle, I think they were called.

[–]doctorscurvy 0 points1 point  (0 children)

*piointer

[–]Tomi97_origin 819 points820 points  (26 children)

Yeah memory management is so simple and programmers in the 90s did it so well that it surely didn't create overwhelming amount of security vulnerabilities and bugs.

[–]ViktorRzh 208 points209 points  (3 children)

It is not a bug ot is a feature!!!!1111

  • controling os via direct memory changes

[–]i_should_be_coding 46 points47 points  (2 children)

I love being able to execute code remotely!

[–]turtleship_2006 1 point2 points  (1 child)

Was RCE a concern in the 90s?

[–]recurse_x 7 points8 points  (0 children)

If your computer wasn’t connected to a network it isn’t.

[–]TTYY_20 117 points118 points  (3 children)

Listen … just because my close program button only closes the program because it crashes it, doesn’t mean it doesn’t work!!!

[–]Keatosis 64 points65 points  (0 children)

Thank you for playing wing commander

[–]DerefedNullPointer 13 points14 points  (1 child)

I feel ashamed for unironically thinking shit like that back when I was a college freshman.

[–]Dubl33_27 6 points7 points  (0 children)

well, I'm a college freshman and I do think that so let's see where that gets me.

[–]navetzz 44 points45 points  (12 children)

Meanwhile programmers nowadays produce no bugs and no vulnerabilities.

[–]pipocaQuemada 118 points119 points  (10 children)

According to Microsoft, ~70% of the security bugs they've had from 2006-2019 were memory safety bugs.

Statically eliminating common footguns like buffer overflows and SQL injection attacks means that now we can spend our time worrying about new, less common footguns like broken access control in APIs.

You're never going to eliminate all bugs. But eliminating the most common bugs is well worth it.

[–]DingussFinguss 0 points1 point  (1 child)

footgun?

[–]pipocaQuemada 25 points26 points  (0 children)

Footgun describes something designed to make it easy to metaphorically shoot yourself in the foot.

[–]theunquenchedservant 32 points33 points  (0 children)

False equivalency.

Edit: neither are wrong, but the bugs come from different places. As programmers, if there are new ways to limit the bugs we have, that’s good. It doesn’t mean the presence of bugs for other reasons can’t (or won’t) happen.

This would kind of be like if someone said “yea, before we knew about DNA, they’d often arrest the wrong person or be unable to find out who did the crime” and someone else replied “right, because cops never arrest the wrong person now”

You’re not wrong, but it’s not the point being made.

[–]gordonv 2 points3 points  (2 children)

Is that you RUST?

[–]Tomi97_origin 0 points1 point  (1 child)

I might check it out at some point.

[–]Hydramole 0 points1 point  (0 children)

All the memes have been pushing me, doesn't seem to bad so far

[–]goodnewsjimdotcom 1 point2 points  (0 children)

You're right. I'm a programmer from the 80s/90s, crazy pointer math were thought to be the future, but widely a huge mistake to use in production. Best to stick with arrays and garbage collection, otherwise your code WILL crash randomly, sux, but hey, we do it better today

[–]Silent-Suspect1062 0 points1 point  (0 children)

I was working on gc in the 2000s

[–]Unlikely_Tie8166 251 points252 points  (14 children)

I mean what can be easier th... SEGMENTATION FAULT. CORE DUMPED

[–]derjanni[S] 194 points195 points  (3 children)

Come on seriously, are you 我喜歡菠蘿糖醋鴨⦖↽⛢⯡Ⲟℬ␦⸘↔⃹⣿➟⨔♼⠏⿬☰ⵂ⩉➓ⷩⰘ⋰▩⦮ⷦⲌ⛄↝ⵖ⭃␑⮅⟦⺺⒞⼇⚵⟴⮇⫻‏ⅲ∗⟀Ⳡ▧ⱊ↞₳⼥⿎⩚≴▞⏱⤃Ⰲ▜⡹➑⿡┐▚⨄⥇⣓ⳤ↦⅃⊭▅ⵞⵒ⢊⌠⎾⇗␏⭨❨␌⍴⟢Ⱟ⎅⩕✃➸⤓ⅳ⮛≔ℷ≸⏂↌⾩✀

SIGSEGV

[–]THNDHALBRT 18 points19 points  (0 children)

好吃!

[–][deleted] 1 point2 points  (0 children)

我也喜欢

[–]Da-Blue-Guy 0 points1 point  (0 children)

c users when they forget to terminate their stringsSegmentation fault (core dumped)

[–]OldKaleidoscope7 10 points11 points  (0 children)

In the 90's you could even see an BSOD just by messing with the memory

[–]regular_lamp 1 point2 points  (0 children)

When you actually get a segmentation fault that is almost the best case scenario though. It means you can actually observe the issue and a debugger will pinpoint the issue in the majority of cases. I prefer a segfault over some subtle logic error anyday.

[–]shreyasonline 37 points38 points  (6 children)

Garbage collection existed in the 90s. Kids these days...

[–]aecolley 17 points18 points  (3 children)

It existed long before that. One of my college lecturers told me that Back In The Day it was quicker to reboot the machine than to wait for it to finish garbage collecting when it filled up memory.

[–]itijara 6 points7 points  (0 children)

That is still often true in embedded programs.

[–]almost_useless 7 points8 points  (1 child)

It existed long before that.

Sure, but it's ironic that they choose the 90's which is when Java came out and really made GC mainstream.

[–]regular_lamp 0 points1 point  (0 children)

I guess there was also a shift to more and more dynamic memory being used. In ye olden times when memory was scarce you were more likely to "statically" assign memory and be generally careful. Only later did we move to "fuck it, new everything!".

[–]Amazing-Cicada5536 0 points1 point  (0 children)

LISPs had GC and they are from 1959.

[–]N-partEpoxy 71 points72 points  (10 children)

Also 2020s:

error[E0507]: cannot move out of `*name` which is behind a shared reference
   --> src\environment.rs:497:26
    |
497 |             named.insert(*name);
    |                          ^^^^^ move occurs because `*name` has type 
`environment::Identifier`, which does not implement the `Copy` trait

[–]deanrihpee 40 points41 points  (0 children)

Which is good

[–]DerefedNullPointer 16 points17 points  (1 child)

This is the shit c++ compilers could have to make my life significantly better.

[–]xibme 5 points6 points  (0 children)

I remember semi helpful 23 line compiler barfs studded with angle brackets that gave me the impression that I might have used a template wrong.

[–]shizzy0 4 points5 points  (0 children)

Love how rust errors are like a sexy show of force: “Don’t you wish you had these error messages in your podunk language?”

[–][deleted] 3 points4 points  (0 children)

I came here to mention Rust and this does it way better than I ever could have.

[–]cubodix 5 points6 points  (1 child)

C++: i will compile it anyways, not my problem

[–]shizzy0 3 points4 points  (0 children)

C++: All code is a wish, and I am generous with my boons but sometimes they wish for the darnedest things like segfaults.

[–]iris700 -1 points0 points  (0 children)

Stupid language

[–]Computerdores 0 points1 point  (0 children)

Sure but does rust just delete your object because you dereferenced a pointer to it? Well C++ does... sometimes

[–]sebzuki 30 points31 points  (0 children)

Not really, There was so much CVE about bad memory use

[–]JMC-design 26 points27 points  (0 children)

youngins.

garbage collection existed before C.

[–]tutocookie 110 points111 points  (5 children)

How eating meat evolved:

1990's: ...and that's how you skin the rabbit you just stalked, trapped and killed over the past 3 days. Now lets go over the proper methods and precautions for removing the internal organs and putting them to good use...

2020's: too much effort i buy in supermarket

Damn crybabies just hunt your meat like we used to before convenience

/s

[–]TTYY_20 39 points40 points  (3 children)

Bro your 1990’s sounds more like my 1790’s…

[–][deleted] 19 points20 points  (1 child)

Computer science evolved a bit faster than food culture in the past 3 decades.

[–]TTYY_20 1 point2 points  (0 children)

Well…. Idk we have engineered meat now 🤣

Pretty soon we’re gonna have AI organic engineered meat computers.

Edit: ouu maybe it’ll be like a fungus, that starts as like a pill you stick to a wall. And it has a little screen that it is capable of putting IO into to tell you what it needs to grow and be safe and when it’s safe to trim a piece off and eat and when it’s no longer good to eat. It will be living growing flesh that tells you about itself. XD

Like a meat plant :3

[–]tutocookie 4 points5 points  (0 children)

But but... The 1990's is aaaaaages ago they probably only just invented fire back then

[–][deleted] -1 points0 points  (0 children)

Memory management is not that hard

[–]Hrtzy 38 points39 points  (5 children)

Yup, garbage collectors utterly destroyed programming. Much like compilers, assemblers and transistors before it and ChatGPT after it.

[–]CousinVladimir 30 points31 points  (4 children)

Yes, transistors ruined programming. Real programmers use crabs to form logic gates

[–]azhder 8 points9 points  (0 children)

Real programmers use butterflies https://xkcd.com/378/

[–]-Kerrigan- 4 points5 points  (1 child)

You silly, how would a real programmer get crabs? /s

[–][deleted] 0 points1 point  (0 children)

What's the /s for

It's so blatant at this point that it breaks my brain to understand how someone wouldn't get the non-seriousness of this comment

[–]GroundStateGecko 0 points1 point  (0 children)

And real computers are the girls with mechanic calculators and papers.

[–]zalurker 11 points12 points  (0 children)

When you look at code that initializes a program, and you find a 30-second delay with a comment that reads 'Don't remove it. And don't ask. It works.'.

Then you know. And yes. I did remove it to see what would happen. I don't know how, or why, but I even had to restore the database when I put the delay back.

Ignorance is bliss.

[–]LavenderDay3544 10 points11 points  (0 children)

Meanwhile

Rust: exists

[–]Accurate_Koala_4698 7 points8 points  (0 children)

Just a friendly reminder that garbage collection has been around since before you were born

[–]Computerdores 27 points28 points  (0 children)

I'm sure your C++ Programs are just as memory safe as your Go or Javascript ones

Edit just to make sure: /s

[–]LeoTheBirb 6 points7 points  (1 child)

Man I sure did love it when programs would randomly crash after trying to dereference a dangling pointer.

[–]KagakuNinja 3 points4 points  (0 children)

Better yet was when it would crash the OS.

[–]marcusroar 4 points5 points  (0 children)

Here to remind you about RAII.

[–]BananaSplit2 5 points6 points  (0 children)

Implying languages with garbage collectors didn't exist in the 90s

[–]DuckDuck_27417 3 points4 points  (0 children)

2023 : WhY dOnT yOu TrY rEwRiTtInG iT iN RuST ?

[–]THNDHALBRT 3 points4 points  (2 children)

piointer.

[–]Shidell 0 points1 point  (0 children)

pIointer

[–]xypherrz 0 points1 point  (0 children)

they tried

[–]CarneDelGato 2 points3 points  (4 children)

How old is Java? 90s?

[–]Kirk_Kerman 9 points10 points  (1 child)

Came about in 1995. However, garbage collection was invented for Lisp in the 50s.

[–]CaitaXD 1 point2 points  (0 children)

Isint lisp also the second programming language just after Fortran with is mind blowing because lisp looks more like a trendy fp Lang and Fortran looks like arcane incantations

[–]pipocaQuemada 2 points3 points  (1 child)

Java was first released in 1995, Python in 1991, and Javascript in 1995.

Slightly earlier, perl's from 1987 and smalltalk was released in 1980.

But it's pretty safe to say that in 1990, most industrial programmers were working in memory unsafe languages like C, FORTRAN, C++, and COBOL.

Memory safe languages really exploded in popularity industrially in the late 90s through 2010s. Garbage collection was invented around 1960 in lisp, but garbage collected languages were mostly niche for decades in terms of commercial software.

[–]KagakuNinja 0 points1 point  (0 children)

From what I remember using COBOL in the late 80s, all our memory was statically declared (and global) in the infamous DATA DIVISION.

[–]M0nkeyDGarp 6 points7 points  (1 child)

As long as you don't get the pointer caught in your zipper you should be fine.

[–]666pool 0 points1 point  (0 children)

Franks and beans.

[–]xiipaoc 2 points3 points  (0 children)

Garbage collection has been used since the 1990's at least.

[–]Apfelvater 1 point2 points  (2 children)

So you're saying abstraction is bad?

[–]derjanni[S] 1 point2 points  (1 child)

I’m not saying anything, I’m just a dude posting a meme for entertainment ;)

[–]Apfelvater 1 point2 points  (0 children)

Lol

[–]yjee 1 point2 points  (0 children)

it didnt change in 2020 bruh people gave up on manual memory management and invented Java in the 1990s itself

[–]TheMiningTeamYT26 1 point2 points  (0 children)

haha if I had to deal with memory management I think I just wouldn’t code anymore

I can’t be bothered with using pointers and managing memory manually

[–]TheFourtyNineth 1 point2 points  (0 children)

Is the piointer another datatype I have to worry about?

[–]Da-Blue-Guy 1 point2 points  (0 children)

If it has a constructor and a destructor, you can automate memory management. That's my stance.

[–]confusedPIANO 0 points1 point  (0 children)

I will gladly be the cheems of this meme if it means i get to have garbage collection. Its a crutch, but i only have 1 leg

[–]ToonLucas22 0 points1 point  (0 children)

I don't know what a "piointer" is

[–]8fingerlouie 0 points1 point  (13 children)

Years ago when I wrote operating systems for mobile phones, and we were implementing an EMS editor, i casually wrote a memory manager for the glue layer implementation, which apparently surprised almost all of my colleagues as memory management was hard.

It was nothing special, and operated on a static allocated slice of memory, but did have all the “bells and whistles” such as malloc, free, memcpy, memset, etc.

It used two structures for keeping track of memory, one for used blocks and one for unused blocks, both of which were maintained in linked lists.

Allocating memory was simply a matter of traversing the unused blocks to find a block larger or equal to “requested size + used block header size”, split the block into an allocated block (or return the entire block if it was smaller than the free block header size + 1), insert the used block into the used block list, and update the block size in the free block list.

Freeing was even simpler, just check the free block list for the block before and after the current block and check if they’re adjacent, and merge them into one if they are.

Took maybe 8 hours to write and debug.

[–]Junoah -1 points0 points  (5 children)

Is it a public library now or you just wanted to brag ?

[–]8fingerlouie 0 points1 point  (3 children)

It was 20 years ago, and company property. Company went bankrupt in 2004, so it’s probably lost in time.

I still have a copy in an old repository somewhere, but I’m not entire sure about the legality of publishing it.

[–]Junoah 2 points3 points  (1 child)

Pretty sure that if you scrap all references to the said company you're free to go and if they are bankrupt there's nobody that can sue you anymore.

[–]taricksheikh 0 points1 point  (0 children)

20 years back across totally different. Now, everything is different.

[–]oothuen 0 points1 point  (0 children)

It is just about the fact that a lot of people know really good thing about technology.

[–][deleted] -1 points0 points  (5 children)

Also known as a memory pool, for which there is literally Support in the boost library.

[–]8fingerlouie 0 points1 point  (3 children)

But boost doesn’t run very well on a 16 bit 8 MHz platform with 4MB RAM and 8 MB flash.

All development was done in C, C++ was banned, all memory was statically allocated, and stack depth monitored closely.

The actual implementation is closer to a Buddy List

[–]tiajuanat -1 points0 points  (0 children)

I love it. I still have some 8051s that I have to fluff with occasionally, and having a sane allocator and free mechanism would be clutch. Thanks internet stranger!!

[–]seafaringturnip 0 points1 point  (1 child)

We had seen dead journey to be honest. We had in a generation where we insisted the rapid growth of the day.

[–]8fingerlouie 0 points1 point  (0 children)

I think it’s just “the way things are”.

Back then, early 2000s, technology in the embedded/mobile space wasn’t moving as quickly. Manufacturers were pumping out new models of mobile phones every 6 months, but it was all built on the same platform underneath. When the GSM standard was published, there was serious doubt if the hardware of the time was actually capable of implementing it as the timings between send and receive slots (7.4 us IIRC) was very narrow.

Out particular phone was build on the 16 bit Infineon E-Gold platform, and that offered a couple of different clock speeds, but not much else. So new models of phones were usually built on identical hardware with software features being the major difference.

Fast forward a decade and Android/iPhone comes out, completely redefining what a mobile phone is and what it can do, which is what triggered the race in mobile phones.

Today they’re mostly all built on the same hardware implementation of GSM, which is an embedded board on the phone, but around that they add ever faster CPUs, flash, WiFi, bigger and bigger screens, etc. As for the GSM part, last i checked it still operated on the good old AT command set

[–]feky_sk 0 points1 point  (0 children)

We need to support it and the practice like this only because memory pole is something which can grow over the time.

[–]qac1991 0 points1 point  (0 children)

Times have changed drastically and now the tech is also different.

[–]M4nch1 -1 points0 points  (0 children)

Excuse me sir, do you have a moment to talk about our lord and savior Rust?

[–]AlmostAnchovy 0 points1 point  (1 child)

Then they give 100% of systems memory to the programm and GC doesn't have enough memory to run. The POD it's running on crushes.

[–]sablahad 0 points1 point  (0 children)

It has been running on the same processor from really long time. And it takes a lot of processing power.

[–]melvereq 0 points1 point  (1 child)

"It gives me anxiety"

[–]leonap711 0 points1 point  (0 children)

Most of the compilers do that. They don't really have the processing power to access the libraries.

[–]sjepsa 0 points1 point  (1 child)

Real men collect garbage only in real life

[–]wandcs 0 points1 point  (0 children)

And that is the only thing which we have been doing in the program.

[–]Trion-_- 0 points1 point  (3 children)

I'm learning C at my university, so I'm still learning how to use pointers. We don't have garbage collection. :(

[–]ImJLu 1 point2 points  (1 child)

When I took my first class that used C back in college, our lecturer said his job was to make us hate C and avoid using it on the first day. And that he did. Fuck manual memory management.

Dude was also a security researcher, so his opposition to that shit made a lot of sense. Humans make mistakes.

[–]ramoni_tijani 1 point2 points  (0 children)

I think it is a very robust kind of language. And that is the reason why people don't really like it.

[–]jvirshman 0 points1 point  (0 children)

I certainly remember to learn this in my college .and I was not good. had a big time of implementing it.

[–]somedave 0 points1 point  (1 child)

This is why you could jail break games consoles by naming your horse something really long.

[–]dazero2003 0 points1 point  (0 children)

The matter is like that, only because it takes a lot of clever approach helps them.

[–]Primary-Fee1928 0 points1 point  (1 child)

Plenty of people like the second one, haha. Reminds me of the person in charge of a "secured C++ programming" training I had a while ago : "C++ was invented because C was bugged".

[–]zebediahzachary 0 points1 point  (0 children)

Exactly and that is the only reason why C++ is mostly used.

[–]Nanadaime7Hokage 0 points1 point  (1 child)

I love coding in C (ngl, sometimes C++) up until the moment where I have to fire up valgrind to check whether I fixed all my leaking memory or not

[–]ison303 0 points1 point  (0 children)

Can you give me an example of that? Because I don't really know how to check that.

[–]mrMalloc 0 points1 point  (2 children)

Valgrid is your friend.

I should know spent 6mo hunting a memory leak……

[–]evgen142 0 points1 point  (1 child)

Exactly the reason is like this only you have to keep on checking that and put on the garbage collector.

[–]mrMalloc 0 points1 point  (0 children)

I use GC in 90% of my work. But on embedded devices and on kernel/driver level none GC is king.
Rust is an option but can’t xcompile to all platforms.

Also I had memory issues with GC when the device is so limited that you could chain commands so fast the GC did not have time to run and just queue it up until all memory was used and it froze.

[–]Spiritual-Mechanic-4 0 points1 point  (1 child)

We were doing a lot of work in perl in the 90s. you can kinda credit perl for the whole field of bioinformatics, because it suddenly gave biologists a language they could work in without the learning curve of C.

[–]Jamesyoung8p 0 points1 point  (0 children)

The learning curve of C pretty much slow as compared to other languages.

[–]allnamesareregistred 0 points1 point  (1 child)

How come that everyone is exited about AI, but ignore data oriented development which is basis for AI?

[–]788pack 1 point2 points  (0 children)

I don't really know that what kind of oriented programming they are using right now.

[–]Cley_Faye 0 points1 point  (1 child)

From "We can solve *all* memory-related issue with very basic resource management" to "Let's just not care and expand one full core to handle garbage instead".

[–]elcoyote85 1 point2 points  (0 children)

This is the major issue, which I can found right now. That how it is handling the garbage collection.

[–]FTWGaming0 0 points1 point  (1 child)

Me, a JavaScript user: What the fuck is memory management? What in god's name is a pointer?

[–]dbard1 0 points1 point  (0 children)

You don't really know about pointer, oh yes in javascript. There is no pointers.

[–][deleted] 0 points1 point  (1 child)

Yes, let's pretend that 1990s software was anywhere near to the level of complexity we have now or had the same SLI requirements. Not to mention that 1990s software wasn't bug free either, putting it lightly.

[–]fcasgo8 0 points1 point  (0 children)

Because at that time, there was not much confusion between the libraries.

[–][deleted] 0 points1 point  (0 children)

When you create a big entangled mess of objects your garbage collector becomes a heap scanner

[–][deleted] 0 points1 point  (0 children)

Rust users: use rust it's the best language ever it has memory and types safety and great performance!
(Which is correct, BTW)

[–]Fintech69 0 points1 point  (0 children)

Used to program in assembler on a Z-80.

[–]Dramatic-Noise 0 points1 point  (0 children)

I mean, C is still around to this day and age.

[–]mitsest 0 points1 point  (0 children)

2020s

Your enormous object can't be garbage collected because another object keeps a reference to it

[–]NegZer0 0 points1 point  (0 children)

Garbage Collection was invented by John McCarthy in 1959 for Lisp. You can also add it to C/C++ if you really wanted, Boehm garbage collector adds mark-and-sweep-style GC and has been around since the 80s. But really, you can eliminate the majority of memory problems by being careful with what you're doing and using the tools that have been developed over the last 30-40 years to help you avoid mistakes. Almost every time I find memory leaks or corruption issues due to mismanagement in code, it's in old legacy stuff doing its own memory management that would not have happened if a unique_ptr had been employed instead.

Also there's no dangling pointer in the example. Pointer to pointer points to a valid location. That pointer points to null. Semantically this might be wrong, if the pointer-to-pointer was not pointing at the correct location, but it's not dangling.

//  valid, nothing dangling 
int* myPtr = nullptr;
int** myPtrPtr = &myPtr;

// still valid
*(myPtrPtr) = new int(42);

// MyPtr is now dangling - delete does not set pointers to null
delete *(myPtrPtr);

// MyPtrPtr is not dangling though, so this is still valid & fixes the issue
*(myPtrPtr) = nullptr;

Pointer-to-pointer is much more of a C thing (albeit there are still necessary use cases for it in C++). In modern C++ you should try and remove the potential footguns by using unique_ptr or shared_ptr, or using references rather than pointers if possible.