Mastering Memory: Allocation Techniques in C, C++, and ARM Assembly

Поделиться
HTML-код
  • Опубликовано: 5 июл 2024
  • In this video, we explore equivalent memory allocation techniques in C++, C, and raw ARM assembly. We discuss the methods and system calls associated with each language to allocate then free memory once a dynamic variable is no longer required.
    ---
    Timestamps:
    00:00 Intro
    01:46 C++ Memory Allocation
    05:41 C Memory Allocation
    09:50 ARMv7 Assembly Memory Allocation
    16:18 Conclusion
    ---
    LaurieWired Socials:
    linktr.ee/lauriewired
  • НаукаНаука

Комментарии • 644

  • @gmjammin4367
    @gmjammin4367 4 месяца назад +267

    I very rarely watch tutorials but the arm segment made this video worth watching.

    • @MarkMusante
      @MarkMusante 4 месяца назад +14

      you're in luck, lauriewired has a whole series on armv7: ruclips.net/p/PLn_It163He32Ujm-l_czgEBhbJjOUgFhg&si=3d2NIEvWJLvbse_X

    • @blackice3403
      @blackice3403 4 месяца назад +2

      ​@@MarkMusanteTY

    • @BlackHermit
      @BlackHermit 4 месяца назад +2

      Same here!

  • @gustinian
    @gustinian День назад +1

    Thank you Laurie you have a rare talent - a thoroughly clear teaching approach. You provide just enough explanation of the reasoning, process and context without overloading the topic. Enjoying the low level assembly language perspective.

  • @StellarFireflyGaming-rm2xu
    @StellarFireflyGaming-rm2xu 4 месяца назад +111

    Not only appreciating the low-level information in the tutorial, but also loving the SE: Lain production aesthetics!

    • @StellarFireflyGaming-rm2xu
      @StellarFireflyGaming-rm2xu 4 месяца назад +7

      My only little complaint is referring to C's malloc() as a keyword instead of a standard library function. I know that at a beginner's level it may as well be treated like a keyword. But it wouldn't have taken much nor would it have been too confusing to beginners, to simply mention that it is a function and then explain why that "#include " is at the top.

  • @PapaSMURFFS
    @PapaSMURFFS 4 месяца назад +41

    Oh man, there are so many callouts to Serial Experiments: Lain in your staging/setting! Long time since I watched it, I love it!

  • @JannisAdmek
    @JannisAdmek 4 месяца назад +26

    I just discovered this channel, the visuals are super neat! The computers in the background, the Windows XP task bar and the window border around the web cam, wow!

  • @sudhanshugorwadkar3839
    @sudhanshugorwadkar3839 4 месяца назад +21

    The amount of effort and dedication you put in editing these videos is commendable👏
    Great tutorial as always!

  • @jessedevore
    @jessedevore 4 месяца назад +95

    Current C++ core guidelines actually recommend against directly using new and delete in favor of smart pointers. std::make_unique and std::make_shared are the way to go. I also get that it's important to understand new and delete. Hats off to you for doing memory management in assembly!

    • @75yado
      @75yado 3 месяца назад +5

      good luck with making equivalent calls in c and asm

    • @tripplefives1402
      @tripplefives1402 3 месяца назад +7

      ​@@75yado smart ptrs use new and delete under the covers.

    • @75yado
      @75yado 3 месяца назад +1

      @@tripplefives1402 I know and a little bit extra to ensure smartness and security and doing that little bit extra in asm or C would prolong the video to several hours

    • @Denis-in6ur
      @Denis-in6ur 3 месяца назад +9

      I hear that a lot. Please, don't let these guidelines take over thinking. Smart pointers have their advantages over the default pointers - but they always come with costs.
      They aren't a fit for every system and every program that gets written. Smart pointers have their flaws and its important to know the difference and when to use them.
      There is no "right pointer". That is a made up concept. Smart pointers are an abstraction layer and as always, the developer has to decide what fits best.

    • @tripplefives1402
      @tripplefives1402 3 месяца назад +6

      @@75yado It's just a container with a pointer in it that has a reference counter that behaves like a garbage collector so you can't use after free.
      You could probably do that in 5 minutes.
      It's even implemented in vanilla C++ code so you could just look at the header files and see how it actually works.
      It's not some super hidden thing in the compiler or anything.

  • @chari6471
    @chari6471 4 месяца назад +14

    Never subscribed to a channel so fast! What a really cool style of video, with clear, helpful explanations. Good up the good work :D

  • @chutipascal
    @chutipascal 4 месяца назад +75

    I like that you use the universal answer to everything for the content of the memory.

    • @NnO0Worries
      @NnO0Worries 3 месяца назад +2

      you 're at 42 likes so I'm just gonna add a thumbs up remark 🙂

    • @YawnGod
      @YawnGod 26 дней назад

      @@NnO0Worries It's at 69 likes right now so I must stop the dirty thinking!

  • @LadyTink
    @LadyTink 3 месяца назад +3

    Love the lain vibes
    Absoluetly a treasure of a show.
    Also, love the walk through thank you for making this walk through

  • @fios4528
    @fios4528 4 месяца назад +6

    I really hope this channel takes off. You put a ton of effort into your content!

  • @rmfeld
    @rmfeld 3 месяца назад +2

    What a wonderful gem of a video! Love the technical deep dive and the graphic design!

  • @julianocardarelli5106
    @julianocardarelli5106 4 месяца назад +21

    Perfect. Nowadays people do not have any idea about low level. Congratulations for bringing up your knowledge.

    • @InternetArbiter
      @InternetArbiter 4 месяца назад

      the computer is not a substitution for living in real life. Don't forget that in all your typing.

    • @julianocardarelli5106
      @julianocardarelli5106 4 месяца назад +6

      @@InternetArbiter , consider that when talking with hardware engeneer or someone who is responsible for a tool like a framework or a virtual machine used by millions of other softwares. Consider that for the set of systems that control the airplane you will travel. Consider that when the can network of your car is running using a microcontroller that has no space to use objet orientation...

    • @ScottHess
      @ScottHess 4 месяца назад

      I still remember when it was reasonable to ask candidates to design a malloc library as an interview question. Sigh.

    • @InternetArbiter
      @InternetArbiter 4 месяца назад

      Guess what, champ. We don't need software like the piles of money investors throw at your inflated salary suggests. Your profession is swiftly coming to a breaking point and you might not even know it if you aren't from the US. Consider that you are following someone else's footsteps, no matter how deep the rat race maze goes for you. Did you find the cheese yet?@@julianocardarelli5106

    • @julianocardarelli5106
      @julianocardarelli5106 4 месяца назад +3

      @@ScottHess , I also remember that. Actually, nowadays it doesn't make any sense in a interview. I agree with that. But it still makes sense for engeneers only, not for 80% of web application developers and mobile developers. Hardware engeneers, developers/engeneers working with embedded software for example, they need to apply those concepts on the video.

  • @Kaspean-sea-monster
    @Kaspean-sea-monster 4 месяца назад +14

    Let's all love Lain!

  • @imalebowski
    @imalebowski 4 месяца назад +15

    Niche af but this is the best RUclips video on memory allocation techniques I've ever seen by a country mile. Seriously, this is an amazing video and you should be proud.

    • @superduper6090
      @superduper6090 3 месяца назад

      Honestly, I have a couple issues. Mostly with the C section of the video. I can ellaborate if you want but im not gonna type it if youre not going to see it.

    • @superduper6090
      @superduper6090 3 месяца назад +1

      Theres also some issues with the c++ section. To be frank the video lacks detail and explanation, and I honestly think there are much better videos out there.

    • @imalebowski
      @imalebowski 3 месяца назад

      @@superduper6090no I'll see it. It's not like I've seen many RUclips videos on memory allocation techniques. But tbh maybe rather than writing a critique here a blog might be better, or another video that can take the mantle.

    • @superduper6090
      @superduper6090 3 месяца назад

      @@imalebowski issues:
      - Using delete and new in c++ is bad practice. make_unique and make_shared is how it should be done.
      - Calling malloc and free keywords. Malloc and free are in no way keywords and referring to them as such can really screw over a person whose learning.
      - This isnt really something they got wrong, but they didnt really explain whats happening when they create a pointer to memory in C. Also, they did allocate memory in C but they didnt really do it in a placr that makes sense since your ints automatically get allocated memory as soon as theyre created. Something better would have been an array of ints.
      These are just the ones off the top of my head.
      The video was ok but I think it could have been better, regardless teaching these things is no easy feat and they should be proud they tried regardless.

  • @blaketurner9389
    @blaketurner9389 4 месяца назад +10

    Thank you Laurie. I love that you run through the C version, being that it is the foundation of most modern memory allocation. The ASM version is absolute candy. Assembler is a dying art. More than ever becoming the domain of a very limited few. A simple clean run through the basics of a controversial and complex topic. 🥳🤓🤠

    • @christopheroliver148
      @christopheroliver148 3 месяца назад

      I think part of that is that the instruction set on most common machines is a quite hairy thing compared with say a Z80, PDP-11, or even 68000. I can usually grok the output from gcc -S or Lisp's #'disassemble. I don't write X86 code though save for doing thing like putting a debug trap into my C copde to break out to the debugger. That's not to say I'm averse to working in assembler for a sane architecture.

    • @christopheroliver148
      @christopheroliver148 3 месяца назад

      I want to add that I think some exposure to assembly language is a must. I just wish there was a UNIX like machine with simpler architecture like to 68000 based Sun 3 for kids to learn on.

  • @0xReip
    @0xReip 4 месяца назад +7

    This channel was one of my best discoveries

  • @BrunoSXS
    @BrunoSXS 4 месяца назад +29

    The effor to create the vfx for those videos are something to marvel on its own...
    What impresses me is that the content is even greater.
    I know my way around 6502 asm and seeing this made me want to do arm asm just because...

  • @user-lv6pb9nv5y
    @user-lv6pb9nv5y 3 месяца назад +3

    Wonderful video. I love the comparisons between C & C++ and ASM. These are my types of video, contrast and comparison!

  • @bdfb-th5ek
    @bdfb-th5ek 4 месяца назад +8

    Great series! I wanted to learn ARM assembly in my spare time and your videos are bite-sized and friendly to newbies

    • @CallousCoder
      @CallousCoder 4 месяца назад +1

      I also have a set of 6 videos on ARM64 ending with actually doing GPIO on the Pi4.

    • @mitigamespro8757
      @mitigamespro8757 Месяц назад

      @@CallousCoder Cool, I might check it out soon!

  • @Beastintheomlet
    @Beastintheomlet 4 месяца назад +3

    This my first video of yours I’ve found (thank you algorithm!) and I absolutely love your style. You’re an excellent presenter and the thematic aspects of an old Apple style GUI is charming without being repetitive. Instant subscribe!
    One small piece of feedback, the dark blue text on a black background was really hard for me to read with my color blindness, just a small thing but wanted to mention it.

  • @stacksmasherninja7266
    @stacksmasherninja7266 4 месяца назад +4

    Great video! Especially the assembly section.
    In my (albeit limited) experience, it often helps to allocate memory in terms of pages rather than individual bytes. The page size is definitely not a consistent or constant standard value that you can simply hardcode in your programs. Effects of page size (fragmentation or page faults) are super apparent when deploying anything large-ish scale (say PostgreSQL db) on your ARM device. If you insist on doing everything in assembly, make sure your program adjusts for this variability in page size when compiling and makes it so that certain variables are "aligned" well for faster access.
    Your C compiler will most likely already handle all of this better than you without you even realizing it which is why in my opinion, programming in C is a "safer" bet for performance, readability and your own sanity.

  • @oszb
    @oszb 4 месяца назад +10

    very dank editing.

  • @emjizone
    @emjizone 3 месяца назад

    @LaurieWired
    Thank you for this instrutive demo.
    I feel at home in the atmosphere you create in these videos, even though my house has never looked like this.

  • @mytechnotalent
    @mytechnotalent 2 месяца назад

    Incredible tutorial Laurie. This is so important for anyone working with dynamic memory. This is something I would recommend coding along on the Pi.

  • @lost4468yt
    @lost4468yt 4 месяца назад +3

    This channel is really impressive. You seem to have everything down somehow - you know a ton about the subject matter, your presenting is brilliant and you can distil your knowledge down, the video style and presentation is fantastic, and so is the cinematography. Really everything is brilliant, and it's clear you're still improving (e.g. I looked through the channel and your thumbnails have gotten way better over the past several months - I love this one and the recursion one).
    Can't believe I haven't seen your videos sooner. Looks like the algorithm has latched onto them though as I'm getting suggested a bunch recently.

  • @mikey38632
    @mikey38632 14 дней назад

    I am relatively new to your content, but after several videos I want to say you are so easy to follow and understand, and interesting to watch as well with your videography and set. Your video and sound are great, and your presentation skill/presence is spot on. I hope to see you on stage one of these days at a tech conference if that is in your plans!

  • @KaustavMajumder
    @KaustavMajumder 4 месяца назад +60

    Python enters the chat.
    "Memory what?"
    Python leaves the chat.
    😁
    Love your videos. Keep up the awesome and inspiring work. I'm digging deep into C++. It's pretty interesting.

    • @blaketurner9389
      @blaketurner9389 4 месяца назад +3

      As Java laughed: "That's garbage"

    • @legion_prex3650
      @legion_prex3650 4 месяца назад +4

      Basic knowledge of memory management should have even a mediocre python developer. but i have seen things.... omg. My assembly times are like 40 years ago but im am still coding in C sometimes. It's fun! But do a lot of python as well nowadays, it's just super convenient and easy. Anyway, you have to know what's going on under the hood. C++ is fun as well, have a nice time!

    • @yarpen26
      @yarpen26 2 месяца назад

      Doing only casual programming at best (and you could barely even call it that much most of the time), I'm somehow drawn to the concept of memory allocation. It just feels wrong for something this crucial to be taken care of by an interpretative layer instead of myself. To be fair, I only semi-understand the pointer stuff based on theory alone, that's why I want to try the real thing. That's the only way to learn, as practice proves.

    • @w花b
      @w花b 2 месяца назад

      ​@@legion_prex3650 I love coding in C but if we're being honest, I'm not doing anything substantial with it unless there's a big abstraction layer like Raylib which actually makes programming in C enjoyable and actually feels like you're moving fast.

    • @thewelder3538
      @thewelder3538 Месяц назад

      What you actually meant was...
      Python enters the chat.
      "Memory what?"
      Three days later, Python leaves the chat after everyone has died of old age.
      😁

  • @georginikoloff9280
    @georginikoloff9280 3 месяца назад

    this video is really great. very neatly explained and the speaker is fantastic

  • @quackcharge
    @quackcharge 4 месяца назад +1

    started learning C recently, very helpful. appreciate it :)

  • @martijn3151
    @martijn3151 4 месяца назад +43

    Just as a best practice tip: always set your pointers to null after dealloc/free.

    • @sheesh7872
      @sheesh7872 4 месяца назад

      @iro4201null like 0 /s

    • @marksmod
      @marksmod 4 месяца назад +13

      and don't forget: the more stars you use, the better.

    • @sheesh7872
      @sheesh7872 4 месяца назад

      ​@@marksmodwheres my very valuable definitly seriös programming comment😢

    • @blaketurner9389
      @blaketurner9389 4 месяца назад +3

      Nothing like using deallocated memory for a little random fun and games 🤣 most days I think this is a lesson best learnt the hard way, one is less likely to forget, EVER again 🤣

    • @mitigamespro8757
      @mitigamespro8757 Месяц назад

      In actual practice, you use asan and ubsan to check for these errors. (And thus no need for these tips like setting it to null after freeing memory)

  • @digicyc
    @digicyc 2 месяца назад

    ohhh the Lain like intro has made me your biggest fan. Really enjoyed this tutorial and your knowledge. Hope to see more, especially around ARM based ASM. ^_^

  • @TetrisMaster512
    @TetrisMaster512 Месяц назад +1

    Heads up for anyone working in C, you don't need to worry about casting the return value of malloc. Unlike in C++, void* will implicitly cast to other pointer types without throwing an invalid conversion error. This just maintains symmetry with casting *to* void* which is implicit in both C and C++. It's ultimately a stylistic decision whether to keep the explicit casts even though they're redundant, but my understanding of what idiomatic C looks like involves just letting the language cast void* for you in basically every situation.

  • @OeHomestead
    @OeHomestead 3 месяца назад

    What a brilliant video, and it sure brings back memories *no pun intended* :-) I started with 68k ASM back in the 80's on the Amiga and continued learning C/C++.

  • @nirmalperera3665
    @nirmalperera3665 4 месяца назад +1

    Thank you! Crystal clear explanation :) Learned a lot!

  • @13p14_
    @13p14_ 4 месяца назад +3

    My God, I love this channel

  • @ajdarseidzade688
    @ajdarseidzade688 3 месяца назад

    A very useful lesson (in different languages!) and very beautifully told!

  • @s1gma9000
    @s1gma9000 2 месяца назад

    the production value is sick, cudos to that for the effort.

  • @timthezombie2566
    @timthezombie2566 Месяц назад

    I am so glad the “serial lane experiment” is used in all your videos.

  • @snesmocha
    @snesmocha 4 месяца назад

    I didn’t expect this to be a good tutorial. You proved me wrong. Damn this is actually really good

  • @jeffreycanipe1936
    @jeffreycanipe1936 7 дней назад

    Just came across these videos. They are awesome!!!

  • @yubtubtime
    @yubtubtime 2 месяца назад +1

    I already knew how to manage dynamic memory in C, so I had a leg up, but those were all better examples than I can remember seeing anywhere else outside of Kernighan and Ritchie! I tried to learn C++ when I was 12, but the syntax seemed needlessly exotic, so I've avoided it since. Your example was clear enough that I finally see the utility though, for example, in its string formatting. I've also kinda' sorta' wanted to learn assembly for 25+ years, but put it off because it also seemed so tedious, but that was such a well motivated example that I have a real itch to try my hand with it in earnest now! Awesome channel-keep up the great work 🙌

    • @haroldcruz8550
      @haroldcruz8550 2 месяца назад

      My only problem with the video is that she type casted a malloc return.

  • @shanks919
    @shanks919 4 месяца назад

    Thank you for the course. It was very helpful!

  • @Slycooper2456
    @Slycooper2456 4 месяца назад +1

    Great vid it is really enjoyable to watch and learn!

  • @DotDager
    @DotDager 4 месяца назад +2

    Excellent as usual!

  • @markus4334
    @markus4334 27 дней назад

    Thank you for the lesson, your voice is incredibly clear and melodic.

  • @Hersonrock12
    @Hersonrock12 Месяц назад

    Really nice video! loved the editing.

  • @WillianSilvaNet
    @WillianSilvaNet 3 месяца назад

    I also have to agree with most of you folks. This video edition is amazing! And thanks for the ARM part. I never saw an ASM code for ARM before. It's quite different!

  • @betatrix8474
    @betatrix8474 Месяц назад

    amazing video from wired, thanks!

  • @mambomambo4363
    @mambomambo4363 4 месяца назад

    Thanks for the video. I learnt a lot about the French revolutuon.

  • @limsiryuean5040
    @limsiryuean5040 4 месяца назад

    Great video on low level programming, especially when explaining programming and memory allocation in parallel. Its even better than codeacademy and other tuturials that I've seen

  • @that_smitty_dude
    @that_smitty_dude 3 месяца назад

    Hi, novice here. Thank you for posting this. I was wanting to learn more about safe memory usage but since I'm trying to teach myself this stuff, I had no clue how it actually works.

  • @gcm4312
    @gcm4312 4 месяца назад

    just found your channel. very high quality content! I think I saw your presentation at Defcon last year (one of the few I managed to attend :D)

  • @david-6110
    @david-6110 4 месяца назад

    Excellent video (and it also reminds me the number of memory allocation mess I did as an enthusiastic Z-80 assembly coder back in the days :D)

  • @TheSpeedturns
    @TheSpeedturns 3 месяца назад

    the lain editing i love it!

  • @c.n.crowther438
    @c.n.crowther438 2 месяца назад

    This is solid af. subbed. thanks.

  • @JhonAlberPerezPerez
    @JhonAlberPerezPerez 4 месяца назад

    In the university I thought assembly was hard but with time, I began using... like it and is very easy... with it I learned to read all type code c,c++,html.

  • @shizoor
    @shizoor 2 месяца назад

    Excellent! Thanks for this!

  • @597das
    @597das 4 месяца назад

    love watching videos on assembly. I'd love to learn more (mainly so I can confidently step through shared libraries while debugging) but I don't really know what a fun assembly project would look like...

  • @bigbooduh
    @bigbooduh 2 месяца назад

    I love your channel, been wanting to learn arm assembly

  • @bxs3514
    @bxs3514 4 месяца назад +3

    Just want to mention that the new in c++ is an override op, which means there’s a second usage for it, replacement new. You can place your data to a specific pre-allocated memory address. It’s a good way to do something like memory pool to avoid fragment/performance issues happen on traditional c++ new. (But be sure to do profiling because modern compile/OS may help you on this kind of things)

    • @surters
      @surters 4 месяца назад +2

      Also for this usage we should use unique_ptr and make_unique (or shared_ptr). The allocators make a lot of work easier in pooling resources.

  • @onaecO
    @onaecO 4 месяца назад +1

    My fav channel! ❤

  • @fairieshavetailscreations
    @fairieshavetailscreations Месяц назад

    Great Video! Thanks

  • @wiebel7569
    @wiebel7569 4 месяца назад +4

    Wow, this was the most compact in depth video I have every seen, amazing. Thank you.
    What I don't get is why are you reassigning #-1 to r0 in alloc_failed, isn't it already #-1 in the first place?

  • @caesare1968
    @caesare1968 3 месяца назад +1

    Beautiful teacher - thanks

  • @Yu-Fei-Hung
    @Yu-Fei-Hung 13 дней назад

    Such an “ancient” reference to Serial Experiments Lain at the title animation! 🤘

  • @IamusTheFox
    @IamusTheFox 4 месяца назад +2

    Bonus points for not treating c as the same as c++

  • @xaza8uhitra4
    @xaza8uhitra4 4 месяца назад

    awesome video Laurie, im learning so much from your work. Uhh can someone help me understand though, with the arm assembly example - was this emulated in the raspberry pi or on other hardware ? and in what OS is she editing the code and running the arm example?

  • @DigitalDesignET
    @DigitalDesignET 2 месяца назад

    I love it, good tutorial. To visualize what is going on, it would be good to do it in debugging mode and look at what is happening in the memory.

  • @sumas7
    @sumas7 3 месяца назад

    I see there are *a few* lain references in this whole channel, and I'm all for it

  • @hacklab6757
    @hacklab6757 2 месяца назад

    Incredible thanks to keep it real !

  • @nathanmarotz8945
    @nathanmarotz8945 3 месяца назад

    lain mentioned!
    busy learning julia and data science rn but bookmarking this for later.

  • @nomad-1776
    @nomad-1776 4 месяца назад

    Thanks for the videos. I'm only on my second semester of computer science and find a lot of this to be confusing, though I'm learning a little bit I think. Some day I'll be able to read and write assembly proficiently too.

  • @user-sl4th2pu1z
    @user-sl4th2pu1z Месяц назад

    Working with numbers and letters is a little depressing. Watching RUclipsrs like you boost my mood for sure. I like my job, but i expected more communication in my team. Respect.

  • @freziyt223
    @freziyt223 3 месяца назад

    Wow, the preswntation actually looks cool!

  • @keopsequinox1624
    @keopsequinox1624 3 месяца назад

    Just discovered your channel. Excellent video.

  • @rafaels.5503
    @rafaels.5503 Месяц назад

    You were able to make a c/c++/ASM vídeo look modern and appealing. I love the "résistance hacker" aesthethic of it, that is the feel low level gives me.
    As for the content itself I'm still a student so I cannot opine on it, I'm just watching and trying to learn from it.

  • @SergeantPepper
    @SergeantPepper 4 месяца назад

    Thanks for showing the ARM assembly memory allocation example. RUclips is lacking in good ARM assembly memory resources.
    I fumbled my way through doing ARM memory allocation using the brk syscall. Now I know where to go if I want to use mmap

    • @CN-Aqi
      @CN-Aqi 2 месяца назад

      Hi friends, I hope to get in touch with you and become friends. I need some technical support, let's create wealth together.

  • @raflend6543
    @raflend6543 4 месяца назад

    Your opening of lain ❤, I love it

  • @markmanning2921
    @markmanning2921 4 месяца назад +4

    It is a better practice to say foo *f = malloc(sizeof *f)) for what ever type foo is
    i think it would also be good if you explained on thre ASM version why you were invoking the C compiler, not everyone will understand the requirement to link your object files after compilation or why you would not just do that using ld itself.

  • @sarundayo
    @sarundayo 4 месяца назад

    Wish teachers in school were half as good as you are 🙌

  • @sasander78
    @sasander78 4 месяца назад

    This video has the best thumbnail I have ever seen

  • @joshuapumphrey9102
    @joshuapumphrey9102 4 месяца назад

    Awesome intro!! One of my fav. miniseries. How did you get the whisper?

  • @ExtremeTeddy
    @ExtremeTeddy 4 месяца назад

    Interesting to see that ASM malloc code including the explanations :) And this 90's transmission style is pleasant to watch. Dang I feel old when thinking about it 😅 Last time I've seen OS windows look similar was when Win 3.1 - Win98 have been around ...

  • @MrHaggyy
    @MrHaggyy 4 месяца назад

    It's quite interesting to look in the assembly generated by the C++ and C programs as well. If you want to go low level with C++ you can use placemet new. It's used to allocate a usefull chunk of memory, like the page you allocated in the ASM version. At a later point you can decide which datatypes you actually want and you can do fast addr+sizeof(dt) shananigans.

  • @91thewatcher23
    @91thewatcher23 Месяц назад

    I thought try catch was generally frowned upon.
    Thanks for the great info. Sick background btw

  • @GandalfTheBrown117
    @GandalfTheBrown117 4 месяца назад

    Great video!!

  • @Soupie62
    @Soupie62 4 месяца назад +1

    Releasing allocated memory is a tidy up function. In Python, some assume the "garbage collection" will fix everything when the program ends.
    Is it a security vulnerability? Do any of these system calls erase the memory contents, or could variable values persist?

  • @mx7233
    @mx7233 4 месяца назад

    It's amazing how you break these things down and novel to do this at a speed where a beginner might actually understand it. 🥳
    What would have been nice is to include the full code somewhere (talking about the assembler part here). As the video appears kind of inviting to code along, for example the code after the exit label is never shown. I had to put this together from other videos. Alternatively it would have been nice to have a pointer to the code/the video for the stub you started with.

  • @mr_noodler
    @mr_noodler 2 месяца назад

    Great channel, very good stuff. What operating system are you running?? super interesting!!

  • @swannschilling474
    @swannschilling474 4 месяца назад

    Really enjoyable 😊

  • @ivelinkarageorgiev3111
    @ivelinkarageorgiev3111 4 месяца назад

    That's the cutest channel ever, loved it ^^

  • @aucusticguitar8069
    @aucusticguitar8069 3 месяца назад

    Keep this up!! Love the video aesthetic. What do you use to create the VFX?

  • @pedrobotsaris2036
    @pedrobotsaris2036 4 месяца назад +4

    You can call mmap in both c and c++. You don’t need to write assembly for that.

    • @christopheroliver148
      @christopheroliver148 3 месяца назад

      Yup. Good for fun tricks like circular buffers where base-index addressing works even off the far end of the buffer. (I.e. map it again at the consecutive address)

  • @luisebaq
    @luisebaq 3 месяца назад

    Very good , usefull information

  • @RushOrbit
    @RushOrbit 4 месяца назад

    Props for good lighting technique.

  • @Calypso694
    @Calypso694 4 месяца назад +1

    no idea who you are but the algorithm has blessed you. Subbed. Cool seeing code girls more often get recognized.

    • @InternetArbiter
      @InternetArbiter 4 месяца назад

      yeah you love seeing psyops and marketing don't you?

    • @Calypso694
      @Calypso694 4 месяца назад

      @@InternetArbiter what?

  • @mohammed.essaber
    @mohammed.essaber Месяц назад

    oh such nostalgia I love you I love c++

  • @nglpos
    @nglpos 4 месяца назад

    Your videos are great. Thanks for producing them. One pointer...you say "go ahead and..." a lot. If you omit that phrase from your delivery, you'll sound even more professional.

    • @CN-Aqi
      @CN-Aqi 2 месяца назад

      Hi friends, I hope to get in touch with you and become friends. I need some technical support, let's create wealth together.

  • @TheGmr140
    @TheGmr140 3 месяца назад

    Nice overview of code types 😊😊