Re: [PATCH 1/1] platform: optimize sysctl_set() to use stack allocated buffer

On Wed, 2016-02-24 at 20:55 -0500, Colin Walters wrote:
On Tue, Feb 23, 2016, at 05:54 PM, Thomas Haller wrote:

The value written to sysctl is usually a short string. It makes
to optimize for this case and avoid allocating a temporary string
on the heap.
Hey, so a while ago I was pushing for NetworkManager to use
which then got backed out in favor of just copying the local alloc

Yes, because we only used gsystem-local-alloc.h, so we copied the file
as is.
Note that this kind of "reuse-by-copying-into-own-tree" has less
downsides then usual copy&paste or re-implementation. We still treat
the copied file as external. So is more like including libgsystem as
git-submodule -- e.g. our copied version is unmodified.

Since then, I've introduced "libglnx", its successor:

It'd likely be a good match for NetworkManager too, as this time it's
a git submodule.  It also has backported local alloc macros.

Now, the reason I'm mentioning this in reply to this message is that
part of
libglnx is shamelessly cloning some of the good parts of libsystemd-
and specifically in this case:

which avoids the hand-rolled string offset handling.

Nice... also to be able to include the ~library~ as git-submodule.

We also have a "shared" directory [2] what contains files that we copy
as-is to nm-openvpn and nm-applet repository. So, that is our ground
base of utilities we want to have everywhere. libglnx would go in this



Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]