Commit Graph

29 Commits

Author SHA1 Message Date
Szabolcs Nagy
c50985d5c8 new tsearch implementation
Rewrote the AVL tree implementation:

- It is now non-recursive with fixed stack usage (large enough for
worst case tree height). twalk and tdestroy are still recursive as
that's smaller/simpler.

- Moved unrelated interfaces into separate translation units.

- The node structure is changed to use indexed children instead of
left/right pointers, this simplifies the balancing logic.

- Using void * pointers instead of struct node * in various places,
because this better fits the api (node address is passed in a void**
argument, so it is tempting to incorrectly cast it to struct node **).

- As a further performance improvement the rebalancing now stops
when it is not needed (subtree height is unchanged). Otherwise
the behaviour should be the same as before (checked over generated
random inputs that the resulting tree shape is equivalent).

- Removed the old copyright notice (including prng related one: it
should be licensed under the same terms as the rest of the project).

.text size of pic tsearch + tfind + tdelete + twalk:

   x86_64 i386 aarch64  arm mips powerpc ppc64le  sh4 m68k s390x
old   941  899    1220 1068 1852    1400    1600 1008 1008  1488
new   857  881    1040  976 1564    1192    1360  736  820  1408
2018-09-20 17:57:47 -04:00
Rich Felker
1366b3c5e6 update authors/contributors list
these additions were made by scanning git log since the last major
update in commit 790580b2fc. in addition
to git-level commit authorship, "patch by" text in the commit message
was also scanned. this idiom was used in the past for patches that
underwent substantial edits when merging or where the author did not
provide a commit message. going forward, my intent is to use commit
authorship consistently for attribution.

as before my aim was adding everyone with either substantial code
contributions or a pattern of ongoing simple patch submission; any
omissions are unintentional.
2018-02-21 14:19:01 -05:00
Rich Felker
f0a6139933 update COPYRIGHT file to clarify that permissions apply for all files
these changes are the outcome of a long mailing list thread that took
place March 2016, "musl licensing". among minor other issues,
prospective users were not confident that the whole-project MIT
license would grant permission for files to which the COPYRIGHT file
expressed a belief that copyright not apply, if it turned out that
these files were actually subject to copyright.

in accordance with the original intent of applying a permissive
license to the project, which was that license issues not be an
obstacle to use, the text which was causing confusion is removed. no
new claims of copyright are made, but new text is added to clarify
that the grant of permissions applies to all files, and an explicit
grant of permission to use public headers and crt files without
attribution has been made.

this patch was reviewed and approved by all substantial contributors
to the affected files: Bobby Bingham, John Spencer (rofl0r), Nicholas
J. Kain, Rich Felker, Richard Pennington, Stefan Kristiansson, and
Szabolcs Nagy.
2016-04-28 20:41:45 -04:00
Rich Felker
dc4520d9c0 fix outdated pathnames in COPYRIGHT file 2016-03-18 23:46:41 -04:00
Rich Felker
589aefa5b0 update documentation files for mips64 port 2016-03-06 17:48:58 +00:00
Rich Felker
790580b2fc update authors/contributors list
these additions were made based on scanning commit authors since the
last update, at the time of the 1.1.7 release, and adding everyone
with either substantial code contributions or a pattern of ongoing
simple patch submission.
2016-02-18 15:14:15 -05:00
Rich Felker
eceaf1d29f update authors/contributors list
these additions were made based on scanning commit authors since the
last update, at the time of the 1.1.4 release.
2015-03-16 18:43:54 -04:00
Rich Felker
4272602ad1 update COPYRIGHT file to reflect new contributors 2014-07-31 16:06:11 -04:00
Rich Felker
4ed1d0a908 update COPYRIGHT file with additional contributor information 2014-03-20 00:34:19 -04:00
Rich Felker
1154e7c9db update copyright dates to 2014 2014-03-06 18:59:51 -05:00
Rich Felker
cccc1844be add arm-optimized memcpy implementation from bionic libc
the approach of this implementation was heavily investigated prior to
adopting it. attempts to obtain similar performance with pure C code
were capping out at about 75% of the performance of the asm, with
considerably larger code size, and were fragile in that the compiler
would sometimes compile part of memcpy into a call to itself.
therefore, just using the asm seems to be the best option.

this commit is the first to make use of the new subarch-specific asm
framework. the new armel directory is the location for arm asm that
should not be used for all arm subarchs, only the default one. armhf
is the name of the little-endian hardfloat-ABI subarch, which can use
the exact same asm. in both cases, the build system finds the asm by
following a memcpy.sub file.

the other two subarchs, armeb and armebhf, would need a big-endian
variant of this code. it would not be hard to adapt the code to big
endian, but I will hold off on doing so until there is demand for it.
2013-08-14 03:06:21 -04:00
Rich Felker
5d37b79793 mention bits headers in another part of copyright file 2013-04-20 14:03:12 -04:00
Rich Felker
a896e89326 update copyright year 2013-04-20 14:02:55 -04:00
Rich Felker
876464622f clarify that bits headers are included as public headers 2013-04-20 14:01:33 -04:00
Rich Felker
22781b4d8e update copyright file for recent contributions 2012-11-14 20:24:46 -05:00
Rich Felker
0d4d1a96e4 update copyright/credits for recent code additions 2012-08-15 00:19:42 -04:00
Rich Felker
3f0636970b relicense musl under MIT license 2012-05-05 00:16:21 -04:00
Rich Felker
8cfbc8be82 update license of njk contributed code (x86_64 asm)
these changes are based on the following communication via email:

"I hereby grant that all of the code I have contributed to musl on or
before April 23, 2012 may be licensed under the terms of the following
MIT license:

Copyright (c) 2011-2012 Nicholas J. Kain

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
2012-05-05 00:02:04 -04:00
Rich Felker
df82f8f2dc update COPYRIGHT status of TRE regex code 2012-03-24 17:46:42 -04:00
Rich Felker
93a50a26cd Merge remote branch 'nsz/master' 2012-03-16 21:01:34 -04:00
Rich Felker
a43c3a337f revert COPYRIGHT file changes in preparation to merge nsz's math branch 2012-03-16 20:52:00 -04:00
Rich Felker
6f21da618f update copyright status (math library and new year) 2012-03-16 19:18:00 -04:00
nsz
3a6c828652 fix copyright notice for the math lib 2012-03-13 16:06:43 +01:00
Rich Felker
febbd12d00 XSI search.h API implementation by Szabolcs Nagy 2011-06-25 18:18:57 -04:00
Rich Felker
c7ce1b20d2 initial commit of prng implementation by Szabolcs Nagy 2011-06-23 18:02:23 -04:00
Rich Felker
22263709ed replace heap sort with smoothsort implementation by Valentin Ochs
Smoothsort is an adaptive variant of heapsort. This version was
written by Valentin Ochs (apo) specifically for inclusion in musl. I
worked with him to get it working in O(1) memory usage even with giant
array element widths, and to optimize it heavily for size and speed.
It's still roughly 4 times as large as the old heap sort
implementation, but roughly 20 times faster given an almost-sorted
array of 1M elements (20 being the base-2 log of 1M), i.e. it really
does reduce O(n log n) to O(n) in the mostly-sorted case. It's still
somewhat slower than glibc's Introsort for random input, but now
considerably faster than glibc when the input is already sorted, or
mostly sorted.
2011-04-27 13:27:04 -04:00
Rich Felker
0b9a1ed00c some docs fixes for x86_64 2011-02-15 14:52:11 -05:00
Rich Felker
05ea04558f explicitly release crt/* to the public domain 2011-02-13 23:32:01 -05:00
Rich Felker
0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00