| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Static analysis has shown that there are many minor memleaks.
|
| |
|
|
|
|
|
| |
References:
- https://stackoverflow.com/questions/79700634/pros-and-cons-of-make-unique-vs-direct-constructor-call-in-c17
- https://towardsdev.com/why-std-make-unique-beats-new-in-modern-c-7e2ba653737e
- https://www.sololearn.com/en/Discuss/3334779/where-make_unique-is-better-than-unique_ptrraw-pointer
|
| |
|
|
|
|
| |
References:
- https://www.reddit.com/r/cpp_questions/comments/pm63yx/why_clangtidy_says_use_emplace_back_instead_of/
- https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html
|
| |
|
|
|
|
|
|
| |
Benchmark:
- https://stackoverflow.com/questions/62058906/why-my-performance-benchmark-gives-me-wrong-results
References:
- https://clang.llvm.org/extra/clang-tidy/checks/performance/prefer-single-char-overloads.html
|
| |
|
|
|
|
|
|
|
| |
std::basic_string_view should not be initialized locally, only
in the std library. Replace it with a simple span instead.
This should fix compilation with LLVM 18+.
Supersedes: https://salsa.debian.org/apt-team/apt/-/merge_requests/511
|
| | |
|
| |
|
|
|
|
|
|
| |
Introduce a scoped object that starts measuring performance counters
and then dumps them into a JSONL file for later analysis.
Add performance contexts for APT::Solver and pkgDepCache::Init()
as starting points.
|
| |
|
|
|
| |
This is like assert() but never compiled out so can be used with
function calls that have side effects.
|
| |
|
|
| |
Explicit iterators considered harmful :)
|
| |
|
|
| |
This splits based upon contiguous whitespace as separators
|
| | |
|
| |
|
|
|
| |
Rather than just setting the flags to 0 or FD_CLOEXEC, read
the current value and append or remove as needed.
|
| |
|
|
|
|
|
|
|
| |
Implement a wrapper around FD_CLOEXEC and use it in place of
the raw fcntl(). This wrapper _Exit()s the child if the operation
failed.
Restructure the close_range() handling to simply mark all fds for
closing first and then "reopen" the ones we should keep.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Use close_range() if we have it in preference to iterating
over /proc/self/fd and falling back to closing all possible
fds.
This builds sets of ranges to close that take into account
the APT::Keep-Fds vector, and a test case is provided to
ensure correctness of the splitting logic.
Preference is given to close_range() over /proc as in the
optimal case, this results in a single system call!
|
| |
|
|
|
|
|
|
| |
This commit fixes the following compiler errors.
apt-pkg/acquire.cc:833:51: error: no template named 'function' in namespace 'std'
apt-pkg/contrib/error.cc:198:59: error: no member named 'front_inserter' in namespace 'std'
apt-pkg/solver3.h:44:22: error: no template named 'is_trivially_constructible_v' in namespace 'std'
methods/http.cc:1029:24: error: no member named 'inserter' in namespace 'std'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function getline is used to read data from different streams, however,
the error handling is not accurate.
From the man page, getline returns -1 on failure and sets errno accordingly,
but the current implementation only checks errno to see if there was a
failure. With this approach, in case getline returns success but also sets
errno it is consider and error.
Fix the issue but also checking the return value of getline.
Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
|
| |
|
|
|
| |
Deduplicate the copies in a central one, mark it unavailable to
external users.
|
| |
|
|
| |
Closes: #1096322
|
| | |
|
| | |
|
| |
|
|
| |
Final ABI cleanup before unstable?!
|
| |
|
|
|
| |
main picked up a couple new ifdefs since the branch started; so
clean them up again.
|
| |
|
|
| |
constant string in .data
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
string{=> _view})
|
| |
|
|
| |
VectorizeString(), StringSplit(), SubstVar()
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This should remain a warning case for now. So push the errors
to a stack and see if we can find any file.
Explictly warn again if Dir::Etc::trusted is set, as it is like
_super_ deprecated.
Reported-By: Cyril Brulebois <kibi@debian.org> in Bug#1032131
|
| |
|
|
|
|
|
|
|
|
| |
This warning has been superseded by the missing sources.list
notice (which will also become a warning shortly)
Adjust the sqv exit to avoid introducing a new spurious
"No good signature" that we did not reach before.
moo
|
| |
|
|
|
| |
Check for empty string_view instead of first byte being '\0';
this otherwise breaks when compiling with higher ABI version.
|
| |
|
|
| |
References: fd3684cdbc165ceaa635ed19fcbd231f509b0179
|
| |
|
|
| |
References: a00fbbdb28cc31e78882301c2efe7218583ab4cb
|
| |
|
|
|
|
| |
Even the long form isn't used much (or currently not at all), but given
that the short form is not really working even if it would be used…
lets drop it and use the long form if we have to.
|
| |
|
|
|
| |
nodiscard is a C++17 feature and already used (not just due to my recent
changes) in our codebase, so lets drop the last remaining holdouts.
|
| | |
|
| |
|
|
|
|
|
|
| |
C++14 includes the standard attribute, so we can use that instead.
Note that we drop the deprecation of {Pkg,Dep}Iterator::operator<< as
this is ignored (a friends declaration must be a definition to have
attributes) very noisily by GCC >= 12 and the methods can be somewhat
useful in debugging if you are to lazy to get APT::Pretty{Pkg,Dep}.
|
| |
|
|
|
| |
[[noreturn]] is a C++11 feature and so we can just use it
unconditionally.
|
| |
|
|
|
| |
They are rather generic names for macros and have no usage in our
codebase at all, so lets remove them for good now.
|
| |
|
|
|
|
| |
That macro is not that useful as it might perhaps once was. Lets prepare
dropping it now in favour of more standard ways of working with arrays
now.
|
| |
|
|
|
|
|
|
|
| |
We were rather inconsistent in using it and as our public headers
contain deduction guides (a c++17 feature) it seems silly to try to hide
a c++11 feature in a macro, so lets stop this charade and drop the
macro and while we are changing all these lines lets apply [[nodiscard]]
(another c++17 feature) and other suggestions from clang-tidy and
formatting for a little more consistency.
|
| | |
|