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



On Tue, Feb 23, 2016, at 05:54 PM, Thomas Haller wrote:
The value written to sysctl is usually a short string. It makes sense
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 libgsystem,
which then got backed out in favor of just copying the local alloc macros.

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

https://git.gnome.org/browse/libglnx

It'd likely be a good match for NetworkManager too, as this time it's *only*
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-shared,
and specifically in this case:

https://git.gnome.org/browse/libglnx/tree/glnx-alloca.h?id=8a7943fef6061a4e9ca368e0042a8a3924affb99#n28

which avoids the hand-rolled string offset handling.


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