git: libdevattr - Visibility change, stop memory waste

Alex Hornung alexh at crater.dragonflybsd.org
Sat Jul 17 02:00:03 PDT 2010


commit 3bbbc629a1226c53dfdeeb2ea6319b4c0fb8c94c
Author: Alex Hornung <ahornung at gmail.com>
Date:   Sat Jul 17 09:46:10 2010 +0100

    libdevattr - Visibility change, stop memory waste
    
    * Change the visibility of some function prototypes in devattr.h to be
      only visible from within libdevattr (or when LIBDEVATTR_INTERNAL is
      specified).
    
    * Stop wasting memory when reading the socket. Since we receive the size
      of the remaining data first, we can allocate exactly the right amount
      instead of wasting it big time by allocating 12MB no matter what.

Summary of changes:
 lib/libdevattr/devattr.c           |   23 ++++++++++++++---------
 lib/libdevattr/devattr.h           |   10 +++++++++-
 lib/libdevattr/devattr_device.c    |    1 +
 lib/libdevattr/devattr_enumerate.c |    1 +
 lib/libdevattr/devattr_monitor.c   |    9 ++-------
 5 files changed, 27 insertions(+), 17 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3bbbc629a1226c53dfdeeb2ea6319b4c0fb8c94c


-- 
DragonFly BSD source repository





More information about the Commits mailing list