On Sat, 06.04.13 10:05, Holger Hans Peter Freyther (hol...@freyther.de) wrote:
From: Holger Hans Peter Freyther hol...@moiji-mobile.com
Avoid memory allocations to construct the path for files in the
procfs. The procfs paths are way shorter than the PATH_MAX so we
can use snprintf on a
From: Holger Hans Peter Freyther hol...@moiji-mobile.com
Avoid memory allocations to construct the path for files in the
procfs. The procfs paths are way shorter than the PATH_MAX so we
can use snprintf on a string located on the stack. This shows up
as a win on x86 using the benchmark program
From: Holger Hans Peter Freyther hol...@moiji-mobile.com
Avoid memory allocations to construct the path for files in the
procfs. The procfs paths are way shorter than the PATH_MAX so we
can use snprintf on a string located on the stack. This shows up
as a win on x86 using the benchmark program
On Wed, 03.04.13 08:27, Holger Freyther (hol...@freyther.de) wrote:
+#define PROCFS_PATH_LEN (sizeof(/proc/)-1 + DECIMAL_STR_MAX(unsigned long))
Even though we use %lu to actually print the PID it's stil in the PID
range, so I'd prefer using DECIMAL_STR_MAX(pid_t) here...
+#define