« first day (1046 days earlier)      last day (3908 days later) » 

11:00 PM
Isn't 18:00 a very odd time to end your day at? (Family) Dinner has ended; all you can do is Pizza and a beer?
 
@CaptainGiraffe At my last count, the overhead lights here have been turned on five times in the last three and a half years :(
 
@CaptainGiraffe no? You just have dinner a little later than other people. If you need to do something social, you simply come in early that day
 
@MooingDuck I guess. My hours are (7-13) - (8-03).
 
I don't know why, but I seem to focus better in the dark. Might just be me, though. A mindset, sort of.
 
11:03 PM
@MooingDuck Hey, what did you mean with your last comment?
"we don't use T_alloc_type::pointer and T_alloc_type::reference like we're supposed to"
 
Xeo
@CaptainGiraffe Wat, we never ate before 7pm
 
@SantiagoPacheco how do you know if an object in the heap can be collected or not?
 
@Xeo When was breakfast?
 
@SantiagoPacheco no wait, let me start over from a different angle
 
ha! good point. You just trust the coder to never delete the object
 
11:06 PM
@SantiagoPacheco allocators were added to support different memory strategies. For some of those strategies, you need nonstandard pointers and references, so allocators contain pointer and reference typedefs.
 
Xeo
@CaptainGiraffe Sometime around 9am I think
 
I'm soo lazy, i do something like that. Super safe gc:
http://pastebin.com/m3mBUMMW
and to use it: GarbageCollector::RegisterObject([=](){ delete[] soundFalloffPt; });
 
@SantiagoPacheco but outside of containers and algorithms, most code doesn't use them ever, which means that "custom memory strategies" must interop with the default T* and T&.
 
you're right
 
@SantiagoPacheco that's.... that's not GC, that's just reinventing std::unique_ptr
anyway, point is, it's impossible to tell if there is T* or T& referring to an object, so it's impossible (for user code) to know if an object can be referenced, and therefore is impossible to know if it's safe to collect.
 
11:08 PM
@Xeo Makes sense. 18 is regular to me. 19 is dinner feast. Yes I am the one doing the cooking
 
yhea, with one small diference. I have controll of when the objects are deleted. The "GC" owns the pointers, so I know they are valid until i release the "GC"
 
@SantiagoPacheco You can tell a smart pointer to let go.
 
@SantiagoPacheco oh, so it's a memory pool. (also not a GC)
 
I've been thinking about GC in C++
 
are we talking about the last thing i post, or the think about my original question?
 
11:09 PM
@SantiagoPacheco Please look in to RAII. We C++ assholes love that shit.
 
@DeadMG with compiler support it could be quite trivial
 
@MooingDuck Nah, I was thinking about as-a-library.
 
gc-int* i_p = new int;
 
no.
 
well, not trivial, but doable
 
11:11 PM
I know, I know,i'm a c++ asshole two, but like i said, too lazy some times. that way i'm sure my pointers are deleted sometime, but they are valid in the program (btw, my "program" is a game engine=
)
 
@SantiagoPacheco You suck.
 
@SantiagoPacheco if the program ends, they're cleaned up by the OS. If your thing happens before the program ends, you have to manually make sure none of the things allocated are still in use.
 
why do I suck, if I want my pointers to be valid for the entire program, and i release the pointers just at the end?
 
What happened to "ThePHD"?
 
In computer science, the Boehm-Demers-Weiser garbage collector, often simply known as Boehm GC, is a conservative garbage collector for C and C++. Boehm GC is free software distributed under a permissive free software licence similar to the X11 license. Design The developer describes the operation of the collector as follows: Boehm GC can also run in leak detection mode in which memory management is still done manually, but the Boehm GC can check if it is done properly. In this way a programmer can find memory leaks and double deallocations. Boehm GC is also distributed with a C ...
there's a c/c++ gc
 
11:14 PM
The X11 license just got null and void. That bloody accountant.
 
C/C++ -> you really suck.
 
@SantiagoPacheco because there's no point? It happens for free automatically when the program ends? That slows down your code for no benefit whatsoever
 
@SantiagoPacheco Why bother releasing them at the end? Let the operating system do it.
just new them up and never delete them.
plus, good way to make sure your code is never, ever re-usable for any purpose.
 
Xeo
@CaptainGiraffe He died, and will be revived in three days as "not-ThePhD"
Maybe someone with the nick "Jesus" should pull that off.
 
@Xeo heh. I first recall that bastard, then I recall another nice guy. Now ThePhd?
 
11:16 PM
@SantiagoPacheco I find it interesting that GCs often have no way of doing an explicit release. I mean, even if it does nothing in most implementations, it opens a door for small optimizations or hybrids
 
how does that affects re-usability. And yes, now that you said it, I could let the os clean up everything. But my allocations only happend at startup( as allocating in the heap 60 times per second is stupid ) so there's not a big slowdown, and i guess it was just that i didn't wanted to leave pointers arround.
 
Y'all remember the Jerry with the blood shot eyes?
 
no.
@SantiagoPacheco Probably because virtually every use case requires that you dispose of your resources before the program ends. So as soon as anything at all changes, your code will have to be completely re-written.
 
that's one of the reasons i don't like them. I want to do what I want with my memory in real world code
 
you can do that and still destroy your stuff on time.
 
11:19 PM
but my destroy time IS program exit. There are just a few object that have less lifetime, and i try to reduce them.
 
@MooingDuck Of course, in Wide, I am the compiler.
@SantiagoPacheco But practically no other program, ever, is the destroy time program exit.
 
Xeo
@SantiagoPacheco ... why do you need a GC for that?
 
Why is the robot disguised as Mysticial
 
for a game, what do you suggest? You load your data, run the game, and destroy everything at exit. If you are doing allocations in the frame loop you'll:
A) fragment the heap
B) slow down everything
 
I can't believe we're still discussing memory management in C++
12
 
Xeo
11:22 PM
@Rapptz wat
 
Is this based on assumption, or have you done something and noticed this problem?
 
I don't. It was just because i don't like to leave pointers dangling arround
 
what problem?
 
A and B.
 
11:23 PM
Man.. I'm so confused with my link
Is that Mysticial or Robot?
Wtf is going on?
 
@Rapptz I don't even...
 
Xeo
@Rapptz Robot
Mysticial has >100k rep
 
:11474572
    {
        int v;
        {
             int w;
        } // <- "variable w" stops living here
    } // <- "variable v" stops living here
 
Xeo
also, the "ogonek" stuff surely means it's robot
 
8 hours ago, by R. Martinho Fernandes
Yes.
I found out through that
Noticed the changed avatar.
 
11:24 PM
Never noticed A, noticed a bit of B, but still, I don't belive is a good design to create a lot of objects just for a really small time. Or I have yet to fund a use for that, I mean, I have never needed to allocate a memory in the frame loop.
 
I've often wondered why there are so few people who hang out here regularly.
 
What would you be allocating exactly?
 
Xeo
@SantiagoPacheco You still don't need a "GC" for that - just have a pool in main or something.
 
5 hours ago, by Rapptz
@chris ehhh.. memory management is a solved problem IMO.
 
Xeo
@Rapptz Not really.
 
11:25 PM
@Xeo I think so :)
 
@SantiagoPacheco LOLWOT.
1970 called, they want their prejudices back.
 
Xeo
@Rapptz Try writing a nice lazy range-library. :/
 
fragmentation is more of an issue when your address space isn't 2GB or bigger, and the new allocators are very low fragmentation, not to mention all of the zero-fragmentation allocators like regions/pools.
and memory allocation is slow but holy shit, it's really not THAT slow at all.
 
Xeo
@SantiagoPacheco Because you totally cannot allocate from a pool while in the game loop, yeah...
 
Why would I add laziness to a strict language?
 
Xeo
11:27 PM
Because it's awesome!
 
Ok, but give me an example where it would make sence to allocate memory in the running loop
sense*
 
Probably depends how you define running loop. Also, I was assuming you knew, because you seem to think you have memory problems.
 
@SantiagoPacheco Well, when your user interacts with the game, then the game's state changes, and that may well require allocating extra objects.
issuing a single Draw call to the GPU costs far more than a couple memory allocations and deallocations, even without a specialized allocator.
 
ah ok, there's a thing here i need to make clear. I don't think i have memory problems, i'm happy as it is, without a pool or a gc.
no, that what you just said doesnt need any allocation
 
@SantiagoPacheco a pool and a good operator== are very useful. :)
 
Xeo
11:30 PM
... how did operator== join the discussion?
 
lol don't ask me
in most games, you have defined what to do in each stage, so you just load it first and then use it
 
@SantiagoPacheco I agree- the general-purpose allocator is just fine for virtually all uses.
 
@Xeo when I have a lot of small objects on the heap that I don't want to delete and new a lot, I use operator= (typo my bad XD) to alter their state instead, rather than deallocate and make a new one, just change them into what the new one would be
 
@SantiagoPacheco Er, cause no game ever had to create objects to represent, I dunno, bullets the player chose to fire? Enemies the player has to face? User-loaded maps? Units the player constructed? Images from files the user may have changed?
 
Can I edit that, get rid of the second =?
 
Xeo
11:32 PM
Meh, any reason for them to be on the heap in the first place?
@AlecTeal Read the newbie hints "click here" link on the right
 
I'm used to using new.
 
Yeah, there could be a non-deterministic (at compile time) amount of them
 
@AlecTeal Press up.
 
That's kind of what the heap is for :P
I did that only went one message back @chris
 
press up again
 
11:33 PM
@AlecTeal Keep going.
 
Xeo
@AlecTeal So you mean std::vector<stuff> or std::vector<std::unique_ptr<stuff>>?
 
@Xeo See, solved issue. :P
 
Or you can use the mouse and take 5 seconds to click the edit link.
 
Depends what stuff does but yes, shockingly the stdlib is very useful :P
 
Xeo
@Rapptz And suddenly, a "for the most part" makes its way in :P
 
11:34 PM
:)
 
@Dea
shit
 
@chris I'm not used to using the mouse at all.
 
Xeo
@AlecTeal ... that's not what I was going for. The main question was <stuff> vs <unique_ptr<stuff>> (aka, extra heap alloc)
Because the latter is clearly redundant in the majority of cases.
 
Oh right, well for a vector unique_ptr is really quite silly.... you kind of ... the vector's job is to own it.
 
Could you store std::unordered_map<Key, std::shared_ptr<void>> for decent resource handling of multiple types?
 
Xeo
11:35 PM
@Rapptz Yeah
 
@Rapptz Probably. I'm not really feeling why you would want to do that, though. What could you possibly do with the values?
 
@DeadMG allocate a new bullet in the fly is not the way to go. that requires to create a GPU buffer, with will stale everything. You just create a bunch and then reuse them. And all the other things aren't loaded in the render loop, they are loaded when the game starts. Loading a level in the render loop( unless you're using some kind of streaming) is insane.
 
Xeo
@SantiagoPacheco Ever developed a game on a console?
 
@SantiagoPacheco Why the fuck would you have 1 GPU buffer per bullet? You can use the same strategies as std::vector for CPU memory for GPU memory.
@SantiagoPacheco The level has to be loaded, and the game has to keep rendering.
 
11:37 PM
@DeadMG I don't know
 
@Rapptz "Nothing", is the answer I'm really seeing, and therefore "You could but it would be pretty worthless to actually do" is my response.
 
Was just a question.
 
I wasn't being mean.
well, I was kinda being mean to Santiago because he appears to be a moron, but I wasn't being mean to you.
 
@DeadMG Each object normally uses a diferent vertex and index buffer. Unless you're doing something like instancing, you are truly creating a GPU buffer for each object. So yhea, store a bunch of bullets, or better, using instancing, is the way to go, but that doesn't require any allocations in the render loop
 
Xeo
@SantiagoPacheco You'll love to know that the Wii had a whopping 88MB RAM - try and see how many things you can keep in memory for the whole game.
 
11:40 PM
and why i'm a moron?
 
@SantiagoPacheco Er, of course you are using instancing.
 
@Xeo That's worse than the PS3!
 
only morons and people whose hardware is from 2003 don't use instancing.
 
Xeo
@DeadMG It's a simple and primitive auto-release pool, basically.
 
@Xeo well that's hard! I feel sorry for the guys that develop for that plataform :( that is probably a very hard job
 
11:41 PM
@SantiagoPacheco Because you said "ER MAH GERD THE PERFORMANCE OF MEMORY ALLOCATION", but you've got nothing to back it up.
 
Holy cow, I thought the PS3 had much too little. I commend Xenoblade even more now.
 
if you ever actually went out and checked how slow it was
you would find that in comparison to rendering or sending commands to the GPU, it's pretty damn trivial.
 
Oh my my my. I have a nephew that is turning 15. His school loves geometry puzzles but refuses to teach limits and derivatives.
 
@CaptainGiraffe No school ever teaches Math properly.
 
@chris Yeah Xenoblade is impressive
 
11:43 PM
@chris Why? My school did!
 
sorry if i ofended you men
 
@CaptainGiraffe Mathematics education is a fuckin' crime.
 
@SantiagoPacheco Yet Nintendo made some really nice looking games there (Brawl, Galaxy (2), etc).
 
Xeo
    88 MB main memory (24 MB internal 1T-SRAM integrated into graphics package, 64 MB external GDDR3 SDRAM)[102]
    3 MB embedded GPU texture memory and framebuffer
^ Wii memory
 
the thing is, no allocation will allways be better than some allocation. So if i can get arround without allocations in the render loop, i'm happy
 
11:45 PM
@CaptainGiraffe Math is about discovery, not memorizing formulas. Of course you have to know certain principles, but it's much more focused on arriving at the right answer than on being able to figure out how to arrive there.
 
Xeo
pools~
 
@Xeo And I that i thought i needed more memory ( got 6 GB right now ) lol
@Xeo pools, pools everywhere
 
@DeadMG Mine was me sitting in the back of the room; fighting my dandruff. When the teacher shoved y(x)-y(x-h) / h I bloody cheered =)
 
@Xeo TIL Nintendo's developers are gods.
 
@SantiagoPacheco Er, no, it really won't.
no allocation won't be better than some allocation at all.
 
11:47 PM
care to explain?
 
in fact, your code is probably full of disgusting unreadable hacks just to get around spending 2 cycles allocating something.
 
@CaptainGiraffe Well, my AP Calculus teacher was extremely good. My Calculus 1 teacher in two weeks is apparently the Jesus of Math teachers as well.
 
Xeo
@Rapptz Pretty amazing, innit
 
Real Analysis ftw.
 
the simple fact is, you should only optimize when you have proven that you A) are running too slowly and B) you have profile data to prove that you know which bit of code is causing the problem.
running around obfuscating your code because "ER MAH GERD THE ALLOCATIONS" is certainly not better.
 
11:48 PM
Anyway, stackoverflow.com/questions/18476913/… how would you guys do that, I'm curious.
Lol
 
it's how garbage gets created.
 
@chris Awesome. As a teacher myself I don't mind stories about good teachers.
 
@DeadMG OMG! I'm drunk, and still agreeing with the puppy.
 
Also let the compiler optimise your stuff, seriously it knows best.
 
but i'm not optimizing. that's just my code desing. And i don't see any unredable hack arround
the thing that could be more "hacky" is this:
 
11:49 PM
@AlecTeal Link dumping is generally frowned upon in this chatroom, deal with it.
 
template<class Function,typename RET>
RET Ternary(Function&& f,RET b,RET a)
{
RET cond = f();
return a * (1-cond) + b * cond;
}
and that had improved the performance of certain operations by 75 %
profiled that time
 
@SantiagoPacheco You designed it that way to avoid allocations because they are slow (when infact they are totally not slow at all). That is a crappy optimization.
 
@SantiagoPacheco Hm.. I can't see why this is hacky.
 
Xeo
@SantiagoPacheco Oh please don't tell me that is for "branchless" comparisions?
 
@Xeo ok, i wont tell you
 
11:50 PM
@SantiagoPacheco Ewww, all upper case parameters? Those are really reserved for macros, you know.
 
@chris We all get criticism. My fav feedback was: "I no longer select courses based on the topics I like. I select the topics where this teacher is teaching."
 
Why can't you do typename T like regular folks?
 
Xeo
@DeadMG "reserved" only as far as the community is concerned
@Rapptz class T // rebel
 
Oddly enough I only use class if I know it's a class.
I know it doesn't matter.
 
@Xeo Well, it's certainly not reserved by Standard, but it is a convention that I find almost everyone follows.
 
11:51 PM
@CaptainGiraffe I'm not going to waste money on a good teacher for a useless course.
 
Xeo
@Rapptz now that's just inconsistent, imo
 
@Rapptz I don't like typename or class
 
@Xeo why didn't you wanted to tell you that was brancheless comparison?
 
I would have loved a second-class keyword, "type"
 
Xeo
@SantiagoPacheco Because it's ugly as fuck
 
11:52 PM
template<type T> <--- look isn't it pretty!
 
No
 
@chris Ouch. Sweden here. Free education, you are allowed to experiment.
 
I also hate "=0" I would have loved an abstract keyword.
 
We already use type => std::enable_if<stuff>::type
Making a keyword is dumb.
 
Xeo
11:53 PM
@AlecTeal No time for that in C++98, according to Bjarne
 
second class keyword, silly, that means it's only a keyword in certain contexts.
 
@Xeo Is not THAT bad:
Ternary([&](){return a*Sign(a) > MaxMin; }, Sign(a)*MaxMin, a);
 
Xeo
It was either = 0 or no pure virtuals
 
@AlecTeal I used type as a keyword to introduce types in my language.
 
@Xeo Good thing IMO. It would have been called pure, which I feel is a bit.. eh.
 
11:53 PM
@CaptainGiraffe Interesting, everything in Canada before university is "free", but it's really not about the money, I want to learn things that I see as useful or very interesting.
 
@Xeo I read his book, "the design and implementation of C++" he goes on about the resistance from new keywords, and now we have =0
 
I can always at least try to get on the teacher's good side and put in extra effort if they don't teach well.
 
@Xeo It's okay, I know it's a bit strange.
 
@chris That is the point here too. All we require is an affadvit of interest.
 
@DeadMG so do I, I also use [ ] instead of { } but still use [] for arrays, comma isn't an operator, structs are POD only, and a few other things.
 
11:54 PM
Sometimes I do class stuff because it's shorter and I'm lazy.
 
I also have a GCC front-end for mine, C and C++ linkage sunglasses
 
@CaptainGiraffe Ours is just taxes and more taxes.
 
Xeo
@Rapptz That's my reason
 
@AlecTeal Yeah - WTF is wrong with 'abstract'?
 
@AlecTeal Definitely cut comma operator, but why on earth would you care about structs being POD only? Or even just keep structs at all?
 
Xeo
11:55 PM
@DeadMG Nooo, my beautiful comma operator :<
 
muh expression sfinae
 
@chris I just recommended a very bright girl from Sudan to study with us, despite not having the formal requirements.
 
Xeo
@Rapptz That doesn't need , to be an operator.
 
@DeadMG lots of reasons
 
@Xeo My beautiful garbage bin.
 
11:56 PM
@MartinJames you sir, got my vote. but, abstract is longer than = 9
= 0*
 
@Xeo Why not?
 
I like pure better.
 
@chris Nooo.
Pure virtual functions aren't even pure.
 
Anyway it's not ready for use yet, but it's coming together, I actually have friends (I can now call colleges) in the comp sci building that like/use the language :) I get to write a paper about the parsing method I "invented" (if one invents with code) ^.^
Riding high atm :) Loving Uni <---first year math student
I didn't do comp sci because 4 years of Java is like.... a punishment.
 
'Pure' is something I make pizza with.
 
11:57 PM
@Rapptz I went off of them being called pure virtual functions.
 
Only C++ calls them that AFAIK
 
I really like abstract
 
Tomato pure, chilli pure...
 
@AlecTeal Eww, 4 years of Java.
 
I'd LOVE Python if it had "abstract" and public/private/protected EVEN more
 
Xeo
11:58 PM
@Rapptz Well, it could just be a thing in the language that sequences expressions.
 
Exactly @chris also I like maths :)
 
NO! You said Phyton!
With that forced whiteline shit!
 
I didn't expect the shovel to the face that is real analysis "You guys thought you could count, lol you fools!"
 
@Xeo decltype(f->stuff(), true) is using the comma operator though (that's what I meant).
 
Phaeton?
 
11:58 PM
@AlecTeal Yeah, our first year CS students use Scheme, but I don't know about after.
 
@SantiagoPacheco I was like that at first, but it makes you do stuff you do anyway, it's a lovely language with operator overloading.
@chris where I am the pure fuckers use gedit PHP and Java.
 
Xeo
@Rapptz Yeah, but that doesn't hinge on , actually being an operator, IMO
 
I shit you not
 
Tonights yes/no poll is simple: "I'm a university prof, I have designed 15 exams for this exam period." Too much? too little?
 
They get provided scripts written for sh that act like little make files.
 
11:59 PM
@AlecTeal Hmm, but write a Blender plugin is not nice. at all
 
I shit you not, they don't use Eclipse, or any other IDE, they use gedit, no version control.....
I cried.
 
@AlecTeal That's what makes me want to go into Math a bit, but I should learn some of it on the side of SE at least.
 

« first day (1046 days earlier)      last day (3908 days later) »