9
0
Fork 0
Commit Graph

6 Commits

Author SHA1 Message Date
Sascha Hauer 54f55d79d9 string: Add (x)memdup
It's a common task to duplicate some memory. Add (x)memdup functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:54 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD afcb5966ef xfuncs.h: include linux/types.h to avoid non decleration of size_t
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:25:18 +02:00
Sascha Hauer 0a0920af28 add xstrdup function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 13:33:57 +02:00
Sascha Hauer 8d38bd967e svn_rev_315
add xzalloc
2007-07-05 18:01:42 +02:00
Sascha Hauer f0c67c6581 svn_rev_283
add xfuncs
2007-07-05 18:01:39 +02:00