[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Pajeet filter

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 56
Thread images: 5

File: MemoryLeak.png (20KB, 459x316px) Image search: [Google]
MemoryLeak.png
20KB, 459x316px
Time to filter out the Pajeets on this board.

If you can't explain why is this code leaking, you are a Pajeet and should just give up programming at all and start construction work or something:
>>
>>59972321
nice way to ask for help with your homework
1/10 made me reply
>>
wtf is a smart pointer ? the pajeet version of a pointer because real pointers are too hard ?
>>
File: 1441597939591.png (135KB, 1418x461px) Image search: [Google]
1441597939591.png
135KB, 1418x461px
>>59972349
>be pajeet
>can't answer a simple question
>"OH WAIT I WILL PRETEND THAT I KNOW BUT I DON'T WANT TO ANSWER CUZ HOMEWERK"
never change, shitskins
>>
>>59972321
>C++
Spotted the Pajeet.
>>
>>59972458
>>C++
>Pajeet

Care to elaborate?
>>
if main() holds a shared_ptr to A, which directly or indirectly holds a shared_ptr back to A, A's use count will be 2. Destruction of the original shared_ptr will leave A dangling with a use count of 1
>>
>>59972321
Disassemble and see at the end of main the compiler will emit code to the standard library which will reclaim / free everything and if for some reason that where to fail then the kernel reaps it all anyways.
>>
>>59972321
Circular reference. This is a problem even in managed languages which use use counts rather than a garbage collector. (Though I prefer languages with use counts because gc has an unpredictable time impact.)

And yes, >>59972632 and I probably just helped you with your homework you faggot.

>>59972458
>pajeet
>knowing c++
Choose one.
>>
Are pajeets not good programmers or something?
>>
>>59972321
>can't even figure this shit out yourself
>needs to make a bait thread on /g/ to get help
>fucking retards help you anyway

and this is why we have 100 "HELP MEEEE REEEE" threads a day.
Totally not going to sage this
>>
>caring about memory

Yes I am a webdev. And the highest extent of my abilitiy will probably be writing C for Python

Memory is Pajeet work.

Embedded engineers need not apply, we just need someone who can copy and paste from Stackoverflow
>>
ITT pajeets calling other people pajeets
>>
Pajeet, Wang, Jamal, Weeabo-chan, is all we got here
>>
>>59972801
pajeet is to /g/ as cuck is to /pol/
It might have meant something a while back, but now it's just "person I don't like"
>>
>>59972834
No its been equated to shit due to poo memes

Or generally just an Indian guy

It's harsh but it's become so common its like saying nigger
>>
>>59972321
Because dependency cycle happens. For n1 to unload, it's link also has to unload. And it's current link is n2. But for n2 to unload, n1 must unload. This can not be resolved, so memory leak happens. Solution: Use std::weak_ptr.
>>
File: Uptime.png (59KB, 748x410px) Image search: [Google]
Uptime.png
59KB, 748x410px
>>59972632
>>59972762
Thank you for help with homework, faggots. Now professor Madhusudan is sure to give me my Programmer Professional Certificate so I can go to USA and be a professional programmer :^)
>>
>>59972482
Most if not all Pajeet universities teach Borland C++, Turbo C++ or some other garbage.

Source: Pajeet
>>
>>59973106
>Borland C++
>Turbo C++

Why do most third-world countries insist on using ancient propietary software? If they are so fucking poor, why don't they just use free software and teach kinds *nix instead of pirating the fucking Windows 98 copies?
>>
>>59972321
Nowhere because it instantly returns to an OS which deallocates all of a process' memory.
>>
>>59972773
a pajeet is like the master jedi of the programming, its kinda slang for really good programmer that knows a lot, but not just technical stuff and skills, but algorithms and very indepth technical specific details
>>
>>59972321
The pointer just never gets deallocated
>>
>>59972762
lol, somebody is asspained. face it - your precious C++ is plagued with Pajeet devs too.
>>
>>59973396
>pajeet
>tries to make pajeets look good
>>
> Not using raw pointers
Kill yourself pajeet
>>
>>59973502
t. pajeet
>>
>>59973502
using raw pointers in situations where it's not absolutely necessary doesn't mean you are "leet", it means you are a fucking idiot.
>>
>>59972321
CIRCULAR REFERENCES BRO, WHAT ARE THEY?!

is everyone on /g/ just a poor c++ developer?
>what is std::weak_ptr
that solves the problem.
>>
>>59973534
But muh superior
>>
you fuckers act as if pointers are some super difficult subject that only the most intelligent of programmers can master. any pajeet / beginning programmer can learn all there is to know about C / C++ pointers in 2 hours, tops.
>>
File: 1492618576755.jpg (25KB, 641x530px) Image search: [Google]
1492618576755.jpg
25KB, 641x530px
>>59972321
Relying on reference pointers as a GC replacement is always a way to spot bad programmers.
>>
>>59973614
calling reference counting a type GC is a way to spot bad programmers desu desu
>>
>>59973614
>REAL programmers manage all allocations and de-allocations manually!
dat superiority complex.
>>
>>59973663
He is true though.
>>
>>59973872
learn some fucking english, pajeet
>>
>>59972321
Is that because of the circular reference? I suppose "smart pointers" (wtf) are based on reference counting, amirite?
>>
>>59972762
>Though I prefer languages with use counts because gc has an unpredictable time impact
What is OCaml. Next time don't try to be smart, just shut the fuck up.
>>
It's a trick question. The program returns immediately so the operation system will reclaim it's memory. There is no memory leak.
>>
>>59972321
Reference loop, or more generally, muddled ownership semantics. Node.link needs to be a weak_ptr here.
>>
>>59974000
No. Only if the process is cleared after that. It could be a problem in embed.
>>
>>59972321
Do people actually know every aspect of C++? Or do they just string pieces they know together and hope that it works?
>>
>>59974164
I use only the C89 subset of C++.
>>
>>59973663
You mean this isn't how to do it?
>>
>>59973308
>If they are so fucking poor, why don't they just use free software and teach kinds *nix instead of pirating the fucking Windows 98 copies?

Consistent bad decisionmaking is usually the reason why a nation/region/are/government is poor anon.
>>
>>59973990
>talking about use counts vs garbage collection
>"hurr durr what about this obscure language?!? now i talk shit!"
The exception is not the average, the average is not the exception. Got it?
>>
>>59974267
hurr durr ignoring the future mainstream language
you're late anon
>>
>>59974176
I thought about looking for a C++03 standard but they fucking removed it. I'm not learning that huge shit called C++14.
>>
why are idiots falling for this bait
>>
File: 1464880364329.jpg (260KB, 1000x1000px) Image search: [Google]
1464880364329.jpg
260KB, 1000x1000px
>>59972321
>using new
>ever
>>
>>59974225
Its the correct way to do it. He's trying to imply that doing things easier rather than correctly is the superior approach.
>>
>>59972321
>using pajeet pointers
>>
>>59972321
the whole point of smart pointerrs is that you don't have to allocate memory using new.
The way you use them creates an object for the pointer and an object with new. You don't need the new. It's also really inefficient, because the temporary object created by new is copied to the object that is created for the shared pointer. So you're creating 2 objects, where 1 is enough.

You should just use smart pointer instead of new. To initialize a smart pointer use make_shared, like it was intended (unless you have a reason not to)
>>
>>59972406
yahoo answers has can help you with your homework anytime, you can ask your professor but chances are you're asking 4chan cause your desperate... Get more mad <3

Also
>being this dumb
>implying pajeets know low level languages
>implying their entire knowledge isn't python and java snippets from stack
>implying that their entire knowledge isn't actually a pajeet hivemind of shared snippets and copy and pasted code and no real work whatsoever, but rather an economy of favors and help for cheating on homework and lying to employers about performance
>>
>people complaning about using smart pointers
>literally the use of one of the best C++ features that is RAII
i guess you guys are better than Scot Meyers, Herb Sutter or even Bjarne himself?

also op learn to use make_shared and make_unique

and you niggas need to learn what is weak_ptr
>>
>>59972321
Only Pajeets put opening curly brackets on a new line. Nice try.
Thread posts: 56
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.