Date: Fri, 15 Aug 2008 17:06:20 GMT From: Konrad Jankowski <konrad@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 147473 for review Message-ID: <200808151706.m7FH6KQg024367@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147473 Change 147473 by konrad@vspredator on 2008/08/15 17:05:56 Integrate (sync) with vendor libc. Affected files ... .. //depot/projects/soc2008/konrad_collation/libc/stdlib/malloc.c#5 integrate .. //depot/projects/soc2008/konrad_collation/libc/sys/setfib.2#5 integrate .. //depot/projects/soc2008/konrad_collation/libc/uuid/Makefile.inc#5 integrate .. //depot/projects/soc2008/konrad_collation/libc/uuid/uuid.3#5 integrate .. //depot/projects/soc2008/konrad_collation/libc/uuid/uuid_stream.c#1 branch Differences ... ==== //depot/projects/soc2008/konrad_collation/libc/stdlib/malloc.c#5 (text+ko) ==== @@ -128,7 +128,7 @@ #define MALLOC_DSS #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.173 2008/07/18 19:35:44 jasone Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.176 2008/08/14 17:31:42 jasone Exp $"); #include "libc_private.h" #ifdef MALLOC_DEBUG @@ -1012,10 +1012,11 @@ /* Exponentially back off. */ for (i = 1; i <= SPIN_LIMIT_2POW; i++) { - for (j = 0; j < (1U << i); j++) + for (j = 0; j < (1U << i); j++) { ret++; + CPU_SPINWAIT; + } - CPU_SPINWAIT; if (_pthread_mutex_trylock(lock) == 0) return (ret); } @@ -2209,8 +2210,8 @@ */ regind = diff / size; } - } else if (size <= ((sizeof(size_invs) / sizeof(unsigned)) - << QUANTUM_2POW_MIN) + 2) { + } else if (size <= (((sizeof(size_invs) / sizeof(unsigned)) + 2) + << QUANTUM_2POW_MIN)) { regind = size_invs[(size >> QUANTUM_2POW_MIN) - 3] * diff; regind >>= SIZE_INV_SHIFT; } else { @@ -2312,7 +2313,6 @@ arena_chunk_alloc(arena_t *arena) { arena_chunk_t *chunk; - arena_run_t *run; size_t i; if (arena->spare != NULL) { @@ -2337,8 +2337,6 @@ /* * Initialize the map to contain one maximal free untouched run. */ - run = (arena_run_t *)((uintptr_t)chunk + - (arena_chunk_header_npages << pagesize_2pow)); for (i = 0; i < arena_chunk_header_npages; i++) chunk->map[i].bits = 0; chunk->map[i].bits = arena_maxclass | CHUNK_MAP_ZEROED; @@ -3536,7 +3534,7 @@ { unsigned i; arena_bin_t *bin; - size_t pow2_size, prev_run_size; + size_t prev_run_size; if (malloc_spin_init(&arena->lock)) return (true); @@ -3583,7 +3581,6 @@ bin->reg_size = quantum * (i - ntbins + 1); - pow2_size = pow2_ceil(quantum * (i - ntbins + 1)); prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); #ifdef MALLOC_STATS ==== //depot/projects/soc2008/konrad_collation/libc/sys/setfib.2#5 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc/sys/setfib.2,v 1.3 2008/07/25 01:09:36 julian Exp $ +.\" $FreeBSD: src/lib/libc/sys/setfib.2,v 1.4 2008/08/08 22:40:04 delphij Exp $ .\" -.Dd May 9, 2008 +.Dd August 8, 2008 .Dt SETFIB 2 .Os .Sh NAME @@ -33,6 +33,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In sys/socket.h .Ft int .Fn setfib "int fib" .Sh DESCRIPTION ==== //depot/projects/soc2008/konrad_collation/libc/uuid/Makefile.inc#5 (text+ko) ==== @@ -1,11 +1,12 @@ -# $FreeBSD: src/lib/libc/uuid/Makefile.inc,v 1.4 2006/03/13 01:15:01 deischen Exp $ +# $FreeBSD: src/lib/libc/uuid/Makefile.inc,v 1.5 2008/08/14 22:23:16 emax Exp $ # DCE 1.1 UUID implementation sources .PATH: ${.CURDIR}/uuid SRCS+= uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \ - uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_to_string.c + uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_stream.c \ + uuid_to_string.c SYM_MAPS+= ${.CURDIR}/uuid/Symbol.map MAN+= uuid.3 @@ -16,4 +17,8 @@ MLINKS+=uuid.3 uuid_from_string.3 MLINKS+=uuid.3 uuid_hash.3 MLINKS+=uuid.3 uuid_is_nil.3 +MLINKS+=uuid.3 uuid_enc_le.3 +MLINKS+=uuid.3 uuid_dec_le.3 +MLINKS+=uuid.3 uuid_enc_be.3 +MLINKS+=uuid.3 uuid_dec_be.3 MLINKS+=uuid.3 uuid_to_string.3 ==== //depot/projects/soc2008/konrad_collation/libc/uuid/uuid.3#5 (text+ko) ==== @@ -23,9 +23,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.6 2005/11/24 07:04:20 ru Exp $ +.\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.7 2008/08/14 22:23:16 emax Exp $ .\" -.Dd January 3, 2005 +.Dd August 13, 2008 .Dt UUID 3 .Os .Sh NAME @@ -52,6 +52,14 @@ .Fn uuid_is_nil "const uuid_t *uuid" "uint32_t *status" .Ft void .Fn uuid_to_string "const uuid_t *uuid" "char **str" "uint32_t *status" +.Ft void +.Fn uuid_enc_le "void *buf" "const uuid_t *uuid" +.Ft void +.Fn uuid_dec_le "const void *buf" "uuid_t *" +.Ft void +.Fn uuid_enc_be "void *buf" "const uuid_t *uuid" +.Ft void +.Fn uuid_dec_be "const void *buf" "uuid_t *" .Sh DESCRIPTION The family of DCE 1.1 compliant UUID functions allow applications to operate on universally unique identifiers, or UUIDs. @@ -74,6 +82,26 @@ respectively. A 16-bit hash value can be obtained by calling .Fn uuid_hash . +.Pp +The +.Fn uuid_enc_le +and +.Fn uuid_enc_be +functions encode a binary representation of a UUID into an octet stream +in little-endian and big-endian byte-order, respectively. +The destination buffer must be pre-allocated by the caller, and must be +large enough to hold the 16-octet binary UUID. +These routines are not part of the DCE RPC API. +They are provided for convenience. +.Pp +The +.Fn uuid_dec_le +and +.Fn uuid_dec_be +functions decode a UUID from an octet stream in little-endian and +big-endian byte-order, respectively. +These routines are not part of the DCE RPC API. +They are provided for convenience. .Sh RETURN VALUES The successful or unsuccessful completion of the function is returned in the
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808151706.m7FH6KQg024367>