« first day (3459 days earlier)      last day (1472 days later) » 

9:31 AM
Do you guys remember the behavior of std::vector's allocation strategy for large arrays. Like if I resize to a 170 gigabyte array, I don't want it to over allocate 1.5x and allocate 255 gigabytes (which would require different hardware).
 
@Mikhail I think .reserve can be exact but you'd have to check the docs
I know if you let it grow naturally it's power of two backoff
 
docs says it can do anything it damn well pleases :-)
There was some difference between gcc and MSVC & clang's backoff - one used power of 2 and the other was like a factor of 1.5 that caused differences in performance. I think MSVC won.
 
 
 
1 hour later…
10:56 AM
is there any post that details good c++ coding practices?
 
@trail99 isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines , but obviously "good practices" are always a matter of opinion
 
user6461957
When it comes to C, I follow Torvalds' coding practices which is akin to the ISO C++ coding practices as far as I am concerned.
 
user6461957
I also try to stick to the terminology used in the "C-sphere", i.e., member functions instead of methods etc.
 
11:12 AM
Well taking advice on C++ from a person that actively despises it is surely one way to do it :P
 
@PeterT yup, everyone has their opinions. I probably meant to say, some of the practices that are widely agreed upon. thanks :)
I just skimmed through the kernel.org doc and I can say that I cringed at somethings cause I use them everyday, uhhhh
 
 
2 hours later…
1:42 PM
I'm trying to fuzz some sorting algorithms but I don't know how to create a good test + inputs for AFL
 
 
2 hours later…
user6461957
3:58 PM
@Morwenn: something with uniform random number generations maybe? Or use a library which somehow captures some entropy (e.g. environment noises).

I would guess that "proper" randomness is key for such things.
 
4:50 PM
@d03 I had it read a file which merely contains a size of the collection to sort and a seed used to shuffle said collection, I guess that it's hardly enough
But I totally lacked examples with actual code written for AFL
 
 
5 hours later…
10:05 PM
So, I wrote this c style SDK five years ago and now I need to upgrade it. Using wchar was not a good idea.
@trail99 So, there are tools like ReSharper that incorporate a few guidelines to check your code. I'd highly recommend them. Costs like $90, or free for students.
 
10:17 PM
Also swprintf_s should check the size of the format
 

« first day (3459 days earlier)      last day (1472 days later) »