I very rarely watch tutorials but the arm segment made this video worth watching.
@MarkMusante10 ай бұрын
you're in luck, lauriewired has a whole series on armv7: kzbin.info/aero/PLn_It163He32Ujm-l_czgEBhbJjOUgFhg&si=3d2NIEvWJLvbse_X
@blackice340310 ай бұрын
@@MarkMusanteTY
@BlackHermit10 ай бұрын
Same here!
@StellarFireflyGaming-rm2xu9 ай бұрын
Not only appreciating the low-level information in the tutorial, but also loving the SE: Lain production aesthetics!
@StellarFireflyGaming-rm2xu9 ай бұрын
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.
@TetrisMaster5127 ай бұрын
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.
@hairold5680Ай бұрын
Not in all versions of c if I'm not mistaken
@JannisAdmek10 ай бұрын
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!
@norbert.kiszka4 ай бұрын
And she also have analog oscilloscopes in the background in a some of her recordings :)
@PapaSMURFFS10 ай бұрын
Oh man, there are so many callouts to Serial Experiments: Lain in your staging/setting! Long time since I watched it, I love it!
@khoaluong604 ай бұрын
well the channel name literally have "wired" in it xD
@sudhanshugorwadkar383910 ай бұрын
The amount of effort and dedication you put in editing these videos is commendable👏 Great tutorial as always!
@fios45289 ай бұрын
I really hope this channel takes off. You put a ton of effort into your content!
@chutipascal10 ай бұрын
I like that you use the universal answer to everything for the content of the memory.
@NnO0Worries9 ай бұрын
you 're at 42 likes so I'm just gonna add a thumbs up remark 🙂
@YawnGod6 ай бұрын
@@NnO0Worries It's at 69 likes right now so I must stop the dirty thinking!
@rmfeld9 ай бұрын
What a wonderful gem of a video! Love the technical deep dive and the graphic design!
@jessedevore9 ай бұрын
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!
@75yado9 ай бұрын
good luck with making equivalent calls in c and asm
@75yado9 ай бұрын
@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-in6ur9 ай бұрын
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.
@jessedevore9 ай бұрын
@@Denis-in6urUsing smart pointers should always be the default. Not using one would require very special circumstances.
@75yado9 ай бұрын
@tripplefives1402 it's easy - try to do the same in asm and publish the video. And pleae do not forget that control block is thread safe but the pointed object is not. The point is that some concepts are not present at lowest level and introducing them could cause problems - not the big ones but composition of the video/tutorial would be pretty messy. That was my message
@chari647110 ай бұрын
Never subscribed to a channel so fast! What a really cool style of video, with clear, helpful explanations. Good up the good work :D
@0xReip10 ай бұрын
This channel was one of my best discoveries
@LadyTink9 ай бұрын
Love the lain vibes Absoluetly a treasure of a show. Also, love the walk through thank you for making this walk through
@gustinian5 ай бұрын
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.
@Kaspean-sea-monster10 ай бұрын
Let's all love Lain!
@BrunoSXS10 ай бұрын
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...
@bdfb-th5ek10 ай бұрын
Great series! I wanted to learn ARM assembly in my spare time and your videos are bite-sized and friendly to newbies
@CallousCoder10 ай бұрын
I also have a set of 6 videos on ARM64 ending with actually doing GPIO on the Pi4.
@mitigamespro87577 ай бұрын
@@CallousCoder Cool, I might check it out soon!
@lost4468yt9 ай бұрын
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.
@MichaelSmithzer9 ай бұрын
Wonderful video. I love the comparisons between C & C++ and ASM. These are my types of video, contrast and comparison!
@stacksmasherninja72669 ай бұрын
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.
@julianocardarelli51069 ай бұрын
Perfect. Nowadays people do not have any idea about low level. Congratulations for bringing up your knowledge.
@InternetArbiter9 ай бұрын
the computer is not a substitution for living in real life. Don't forget that in all your typing.
@julianocardarelli51069 ай бұрын
@@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...
@ScottHess9 ай бұрын
I still remember when it was reasonable to ask candidates to design a malloc library as an interview question. Sigh.
@InternetArbiter9 ай бұрын
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
@julianocardarelli51069 ай бұрын
@@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.
@martijn315110 ай бұрын
Just as a best practice tip: always set your pointers to null after dealloc/free.
@sheesh787210 ай бұрын
@iro4201null like 0 /s
@marksmod10 ай бұрын
and don't forget: the more stars you use, the better.
@sheesh787210 ай бұрын
@@marksmodwheres my very valuable definitly seriös programming comment😢
@mitigamespro87577 ай бұрын
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)
@bonafontciel2 ай бұрын
This doesn’t necessarily apply. Better to run a Clocwork or Coverity Scan
@bxs351410 ай бұрын
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)
@surters9 ай бұрын
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.
@Beastintheomlet9 ай бұрын
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.
@timthezombie25666 ай бұрын
I am so glad the “serial lane experiment” is used in all your videos.
@yubtubtime8 ай бұрын
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 🙌
@haroldcruz85508 ай бұрын
My only problem with the video is that she type casted a malloc return.
@emjizone9 ай бұрын
@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.
@mikey386326 ай бұрын
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!
@OeHomestead9 ай бұрын
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++.
@13p14_10 ай бұрын
My God, I love this channel
@ajdarseidzade6889 ай бұрын
A very useful lesson (in different languages!) and very beautifully told!
@markus43346 ай бұрын
Thank you for the lesson, your voice is incredibly clear and melodic.
@antiimperialista6 ай бұрын
NOO IT IS NOT
@oszb10 ай бұрын
very dank editing.
@KaustavMajumder10 ай бұрын
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.
@legion_prex365010 ай бұрын
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!
@yarpen268 ай бұрын
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花b7 ай бұрын
@@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.
@thewelder35387 ай бұрын
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. 😁
@s1gma90008 ай бұрын
the production value is sick, cudos to that for the effort.
@WillianSilvaNet9 ай бұрын
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!
@turdwarbler9 ай бұрын
malloc and free ARE NOT key words at all, they are function calls in the standard C library.
@fntr8 ай бұрын
ok and?
@ShuAbLe6 ай бұрын
I think the meaning of key words here is in the sense that these are the words you have to remember to do the job. Not as defining what they are...
@turdwarbler6 ай бұрын
@@ShuAbLe Learning a new programming language is difficult and use of the correct terms is very important otherwise as you go away and google questions you get confused when people refer to malloc as a keyword and other people refer to it as a function call. Which is right ?. If you are going to go online and attempt to teach people things, then you need to get the basics correct. language keywords and library function calls are two completely different things.
@Lampe20206 ай бұрын
1:01 Okay, I don't know id that's my screen's fault, but that dark blue text is basically invisible on the black background. But maybe my non-glaring screen brightness coupled with night colours is the culprit here.
@nsawatchlistbait2899 ай бұрын
Where'd you learn all this?
@basedfacistman8 ай бұрын
memory allocation is like the most basic thing you'd learn when you start learning any manual memory management language, pick up a book, id suggest K&R for C, it also has a simple malloc implementation by ken thompson in the last chapter, with that you should learn everything you need to
@nsawatchlistbait2898 ай бұрын
@@basedfacistman oh
@georginikoloff92809 ай бұрын
this video is really great. very neatly explained and the speaker is fantastic
@that_smitty_dude9 ай бұрын
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.
@quackcharge10 ай бұрын
started learning C recently, very helpful. appreciate it :)
@snesmocha9 ай бұрын
I didn’t expect this to be a good tutorial. You proved me wrong. Damn this is actually really good
@nirmalperera36659 ай бұрын
Thank you! Crystal clear explanation :) Learned a lot!
@michaelbauers880010 ай бұрын
I get the point of this video, I just wanted to add something. II you are doing serious C++ development, you probably want to use std::shared_ptr, and similar smart pointer allocators. When the last reference goes out of scope, the memory will be released. I am sure there's situations where this will cause problems, but for typical use cases, this might simplify the program.
@dazealex9 ай бұрын
Aww man, I am so behind on the new things in C++, last time I worked with it was in 1998... Things have changed for the better. Thanks for the tip.
@IamusTheFox9 ай бұрын
@@dazealexoh man, you'll love it! So many things that will make your life better. Jason Turner has made a few videos on the most important features of c++11,14,17,20, and 23 if you want a quick reference I'd start there
@dazealex9 ай бұрын
@@IamusTheFox Oh thanks man! Will check those out. Sounds like fun, and back to C++!
@QuantenMagier7 ай бұрын
This is one of the reasons why C++ is worse than C; people don't know how to write proper code anymore and just trust weird garbage collections to manage their memory. I mean I can sometimes see use in reference counting like std::shared_ptr, but "when the last reference goes out of scope" makes me worry; please use proper delete statements even for your shared pointers and dont abuse them as garbage collectors to "simplify typical use cases", having a shared pointer means multiple references to the same object from different scopes and is not a typical use case, using them for single reference garbage collection is just abuse.
@IamusTheFox7 ай бұрын
@@QuantenMagier Respectfully, I don't think you fully understand smart pointers. shared_ptr is not GC, and is an atomically counted variable that frees the memory when the counter is 0. I agree that you shouldn't reach for shared_ptr as your go-to tool. unique_ptr basically just calls the deleter when the object goes out of scope. No counting, nothing.
@pogchamper2286 ай бұрын
Working with numbers and letters is a little depressing. Watching KZbinrs like you boost my mood for sure. I like my job, but i expected more communication in my team. Respect.
@digicyc7 ай бұрын
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. ^_^
@DotDager10 ай бұрын
Excellent as usual!
@DART2WADER7 ай бұрын
2:20 Use everything from the header instead of the 'new' and 'delete' .
@limsiryuean50409 ай бұрын
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
@pedrobotsaris203610 ай бұрын
You can call mmap in both c and c++. You don’t need to write assembly for that.
@christopheroliver1489 ай бұрын
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)
@bologcom5 ай бұрын
Now I've got the answer to the ultimate question of life, the universe, and everything!
@sumas79 ай бұрын
I see there are *a few* lain references in this whole channel, and I'm all for it
@rpeckhoff10 ай бұрын
Topic I'm passionate about... very competent presenter...who happens to be attractive... clean editing with dope 90's references that remind me of Beakman's world. Maybe there's no drama? I'm trying to put my finger on why I'm bored. Maybe its more entertaining if things are broke? I still love the content from Laurie Wired.
@lauriewired10 ай бұрын
would it help if I threw the computer at the wall to free the memory?
@rpeckhoff10 ай бұрын
@@lauriewired rofl! Got to keep all the badgers and snakes inside those classic machines of yours. Maybe a few syntax errors or memory errors?… what llvm vs gcc says… or static checker when you screw up? Dunno. Keep on. Still very much looking forward to your next video. They’re very well made.
@CN-Aqi8 ай бұрын
Hi friends, I hope to get in touch with you and become friends. I need some technical support, let's create wealth together.
@sterlingveil4 ай бұрын
@@lauriewired No, but it might help if you made a few mistakes (on purpose, or organically ala Daniel Shiffman) so us mortals don't get confused when we hit an error in our own adventures...
@ingframin10 ай бұрын
You do not need to typecast malloc in C. You do need it if you use malloc in a c++ program. The C compiler does automatic casting between the void* returned by malloc and your int*.
@lauriewired10 ай бұрын
That's true. However, typecasting is best practice. It makes the code clearer to read, and is taught that way in many universities. Also in the off chance you end up using a C++ compiler with C code, typecasting will reduce compilation errors. I understand how it can be a controversial topic, but it's mostly a stylistic choice.
@richogem10 ай бұрын
there isn't a singular C compiler. always typecast malloc in C or expect the unexpected.
@antred1110 ай бұрын
@em If it's a standard compliant C compiler, you will be fine without the explicit cast.
@richogem10 ай бұрын
@@antred11 why would you ever want to take that chance and risk undefined behaviour? Just use python if u dont wanna bother typecasting?... Always typecast malloc.
@antred1110 ай бұрын
@@richogem Because the C standard itself says you don't need the cast?
@Calypso69410 ай бұрын
no idea who you are but the algorithm has blessed you. Subbed. Cool seeing code girls more often get recognized.
@InternetArbiter9 ай бұрын
yeah you love seeing psyops and marketing don't you?
@Calypso6949 ай бұрын
@@InternetArbiter what?
@code-dredd9 ай бұрын
A few things: 1. malloc/free are functions, not keywords; 2. You don't have to type-cast the return value of malloc; 3. sizeof is also not a keyword, it's an operator; 4. you seem aware mmap/mmunmap are syscalls, but refer to to them as keywords a few times Other than fixing incorrect and/or inconsistent terminology, it was well done.
@nglpos9 ай бұрын
One thing: Your use of "and/or" is incorrect. You should have simply used "and."
@code-dredd9 ай бұрын
@@nglpos Not really. There were some cases where terminology used was correct, but not consistent. Therefore, "or" is warranted.
@nglpos9 ай бұрын
@@code-dredd That's not how grammar of the English language works. Cut your loses...
@code-dredd9 ай бұрын
@@nglpos You've cited no specific language rules here, but whatever helps you sleep at night. Your opinion is not only _demonstrably_ wrong (check a dictionary), but really not relevant.
@nglpos9 ай бұрын
@@code-dredd Sure it is. You've already proven as much. Next time think before you post silly nit-picks.
@timothyLucasJaeger9 ай бұрын
Thank you for the video. Looks like a small typo in the information pop-up at 10:16. Should be 'munmap' not 'mmunmap'.
@DmitriNesterov9 ай бұрын
Несмотря на то, что я знаю и английский и C, и C++, и немного Ассемблер, я ничего не понял, но получил массу эстетического удовольствия 😂❤ Присоединяюсь комментатором, которые пишут perfect.
@JhonAlberPerezPerez9 ай бұрын
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.
@jeffreycanipe19366 ай бұрын
Just came across these videos. They are awesome!!!
@kayakMike10002 күн бұрын
I wrote a deterministic memory allocator in C, for microcontrollers with tons of SRAM. Unused blocks were all saved in a linked list. Allocating memory popped blocks off the top of the list, but only if they were within the size requested. I also updated a journal that could track who was using which blocks... Sorta like the other side of the svc call. I was imagining a tiny OS that ran little apps or could perhaps plugin to the kernel somehow. Requesting memory needed an ID so a misbehaving app could be cleaned up. I was also considering configuring the MPU (if available) so any access requests outside the requested allocation could be trapped. I think you could get at least 8 different regions setup that way...
@markmanning292110 ай бұрын
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.
@AdonaiDio7 ай бұрын
C++: Understandable. C: Ok. Thats fine. ARM V7 ASSEMBLY: "My God, my God, why have you forsaken me?"
@toby99995 ай бұрын
LOL
@nglpos9 ай бұрын
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-Aqi8 ай бұрын
Hi friends, I hope to get in touch with you and become friends. I need some technical support, let's create wealth together.
@sqaxomonophonen59989 ай бұрын
I'm glad I'm not the only one who writes `int* num_ptr` instead of `int *num_ptr` :-)
@colinrk7 ай бұрын
This is my new favorite yt channel. No other coding-tutorial-tubers even come close enough to touch this.
@onaecO10 ай бұрын
My fav channel! ❤
@vattevineeth45676 ай бұрын
16:04 Why did you not have to include the path to static library containing printf ?
@Soupie6210 ай бұрын
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?
@Hersonrock126 ай бұрын
Really nice video! loved the editing.
@TheSpeedturns9 ай бұрын
the lain editing i love it!
@wumperX9 ай бұрын
man the visuals in your videos are nuts.
@wiebel756910 ай бұрын
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?
@luissaybe9 ай бұрын
this video was recommended to me today because i'm usually playing tech videos in the background i completely forgot you work in security i was like "wtf...omg, laurie!?", hope you're doing well
@raiffesilva490810 ай бұрын
Great timing, the US government needs to know being memory safe on C/C++ is really not that hard, next you need to teach them what undefined behavior is.
@sasander789 ай бұрын
This video has the best thumbnail I have ever seen
@IamusTheFox9 ай бұрын
Bonus points for not treating c as the same as c++
@ivelinkarageorgiev31119 ай бұрын
That's the cutest channel ever, loved it ^^
@QW3RTYUU10 ай бұрын
I hope this channel encourages more people to coding! I think if it gives a nice example to lookup to for girls to get into the field. You go and enjoy the coding people!
@cervelliera9 ай бұрын
I do not know anything about code, but great vid (Seriously, great narrator)
@amorsmor852822 күн бұрын
2 weeks ago i decided to write my own malloc Using sbrk syscall And 2 double linked lists to keep track of chunks One list is for allocated chunks And other is for free chunks It is a great idea to implement to level up your C code, and understand how malloc nearly works
@standardtemplateconstruct15969 ай бұрын
what is protocol 7? ive fallen in love with your chrome and format. thats my first comment on video probably ever
@brazni10 ай бұрын
Correct me if am I wrong but this arm example hinges on us being in some kind unix based environment, or else there is no mmap syscall to be made? If we are on our own without an OS the equivalent of dynamic memory allocation would be to simply write to an arbitrary memory address and then keep track of it ourselves?
@kensmith56949 ай бұрын
Yes, this is Unix/Linux related. If this was Windows instead, you would have to write "Please Mr. Bill Gates can I have some memory" and then look for the standard answer of "No, I'm using it all"
@RobbertdeGroot6 ай бұрын
If there is any sort of operating system and memory protection, fetching chunks of dynamic memory will always go through the OS/Kernel to get that memory for the program. If you are in the embedded world or working on some old hardware (C64, Apple II, etc.) and running a single program with really no OS present, then it is much more manual/bare metal memory management. However you might still leverage off of someone else's library to do the work.
@Slycooper245610 ай бұрын
Great vid it is really enjoyable to watch and learn!
@daemon_zero7 ай бұрын
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.
@jamestrent11103 ай бұрын
Thank you for interesting video. For me C++ designed to use/write thin abstractions, so, in case of memory allocation std::make_unique(...) is a way to go. That way it shows strength of higher level. Can combine memory allocation and initialisation, automatic deallocation, no leaks, regardless whether program terminates unexpectedly or succeeds. As for output, no need to use std::endl, cause it forces to flush buffers which is not needed and standard requires to flush it before program ends, but again for modern C++ std::print or std::println is nice abstraction which does the job and simplifies program, makes it more elegant
@freziyt2238 ай бұрын
Wow, the preswntation actually looks cool!
@mambomambo43639 ай бұрын
Thanks for the video. I learnt a lot about the French revolutuon.
@sarundayo10 ай бұрын
Wish teachers in school were half as good as you are 🙌
@betatrix84747 ай бұрын
amazing video from wired, thanks!
@bigbooduh8 ай бұрын
I love your channel, been wanting to learn arm assembly
@blaisofotso343916 күн бұрын
hallo Laurie, Great tutorial. the function malloc returns a void pointer, that is why you have to type cast it to the type of your variable saved in the heap, in this case int
@david-61109 ай бұрын
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)
@GoWithAndy-cp8tz9 ай бұрын
Hi. Malloc returns memory address so it would be enough for better readability: numPtr=malloc(sizeof(int)); if you first declared int * numPtr; alternatively if you want to declare a pointer and assign memory address to it at one step your version is perfect. Cheers!
@RedStoneMatt9 ай бұрын
Am I dreaming or am I seeing a girl who knows C/C++ and ARM? This video is a hidden gem!
@di3809 ай бұрын
For people who don’t appreciate the level of abstraction of a high level language. All the code that is needed in assembly just to allocate an integer in memory dynamically you have to deal with system calls and memory pages since you can not just request 4 consecutive bytes 😢
@DigitalDesignET8 ай бұрын
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.
@shanks91910 ай бұрын
Thank you for the course. It was very helpful!
@MrHaggyy9 ай бұрын
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.