Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 7
Continue readingCategory: Data structures
Layout of std:set (libstdc++)
Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 6
Continue readingData structures – Time complexity (libstdc++)
Cases B … Best case A … Average case W … Worst case If there is nothing mentioned, it matches
Continue readingLayout of std::unordered_set (libstdc++)
Layout The meta element on the stack consumes 7 words (56 Byte on x64, 28 Byte on x86). Each node
Continue readingLayout of std:deque (libstdc++)
Layout The meta element on the stack consumes 10 words (80 Byte on x64, 40 Byte on x86). Each chunk
Continue readingNull-terminated strings (C++)
If you are working with strings you have two basic ways to define its length. Either you write a specific
Continue readingLayout of std::shared_ptr (libstdc++)
Source code Debugging Visual result |———————-| | shared_ptr sPtr1 | |———————-| |Pointer to the Object |—|——-> Object | | |
Continue readingInteger overflow (C++)
Unsigned integer Range: [0,255] Bitfield: 0x00 =++=> 0x01 =++=> … =++=> 0xFF Interpr.: 0 =++=> 1 =++=> … =++=> 255
Continue readingLayout of std::vector (libstdc++)
Source code Analysis Layout |——————————–| | vector vec | | 1 | 2 | 3 | 4 | 5 |
Continue readingBit operations (C++)
Set a bit value |= 1
Continue reading