Programming Leftovers

-
Perl Annual Report - 2021
Thanks to the Team PWC, I completed one more year of weekly challenge. It may not sound a big deal but for me it is. I wouldn't have done without the support of the team. I would like to mention one name, Colin Crain, our in-house, Perl reviewer for the hard work in reviewing Perl solutions every week without fail for so many months now.
-
Rakudo Weekly News: 2022.05 foo = 42
Ralph Mellor published a Request For Comments allowing for a new syntax to define constants in the Raku Programming Language. And quite some discussion followed, and some clarifications. In any case, it caused the creation of one new module in the ecosystem: immutable.
-
No, Linus Torvalds is not Bitcoin's legendary creator Satoshi Nakamoto
One of the great tech mysteries is "Who really is Bitcoin's inventor, the mysterious Satoshi Nakamoto?" Recently, some people thought Linus Torvalds, the developer behind both the world's most popular operating system, Linux, and its most popular development tool, the Git distributed version control (DVC) system, had also claimed he was the world's most popular cryptocurrency, Bitcoin, inventor: The perplexing Satoshi Nakamoto.
-
d-ptr pitfalls | [bobulate]
A “smart” pointer manages a chunk of memory it points to. Examples in Qt include QScopedPointer and QSharedPointer. C++ standard examples are std::shared_ptr and std::unique_ptr.
Smart pointers need a particular implementation: the Qt source code implements the Q-flavored ones (in Qt source code, and there’s only one Qt source code), but the standard ones are implemented by multiple standard libraries. There’s GNU libstdc++ and LLVM libcxx, for instance. There are differences in the implementations.
One important difference lies in the implementation of the destructor of a std::unique_ptr. The LLVM implementation replaces an internal pointer by a nullptr and then calls the destructor of the held object, while GNU calls the destructor of the held object and leaves the internal pointer alone (the std::unique_ptr is being destroyed anyway, so why bother updating the pointer-value).
This becomes visible in some situations where a not-completely-destroyed smart pointer is used: with the GNU implementation it may still hold a valid pointer, with LLVM it holds nullptr. Some will crash, some will not – it doesn’t really matter because to get into this situation you need to be in Undefined Behavior territory anyway and you should be glad that your computer doesn’t catch fire, fall over, and then sink into the swamp.
The visible symptom in a backtrace is an unexpectedly nullptr “smart” pointer.
-

- Login or register to post comments
Printer-friendly version- 2555 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
|
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago