nuttx/libs/libc
chenrun1 a1ccf15e39 idr:Tool for associating discrete ids with addresses
This is a tool for associating discrete IDs with addresses.
This tool is implemented through the red-black tree method provided by <sys/tree.h>, and the time complexity when calling, searching, and deleting is optimized to O(logn)
The implementation is the moving node operation of two red-black trees
1. When applying for a node, it will first check whether there is an available node in the "removed" tree. If so, the memory address of the node will be reused and moved to the "alloced" tree.
2. If the "removed" tree is an "empty tree", then the node will be requested from the memory and added to the "alloced" tree
3. Similarly, when removing a node, we set the address pointed to in the node to "NULL" and move it to the "removed" tree. Next time we alloc the node, we can reduce the overhead caused by memory application
For now, we still have something that can be optimized, and that is the memory elimination mechanism of the "removed tree". The current implementation will only release all the content under the "removed" tree when the idtree is destroyed.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
..
aio libc: Change errno to set_errno and get_errno 2023-10-29 17:16:09 +02:00
assert cmake:bugfix fix CMake LTO build block 2024-08-15 18:01:50 +08:00
audio audio/libsrc: fix build warning 2024-03-26 09:40:42 +08:00
bin
builtin libs/libc: adapt the cmake script from the makefile 2023-11-07 17:39:03 +01:00
ctype Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale). 2024-04-29 17:34:10 +08:00
dirent
dlfcn dlfcn: Fix indent issue in lib_dlopen.c 2024-07-27 03:11:39 +08:00
errno
eventfd
fdt CMake:init arm64 CMake qemu-armv8a build 2023-12-27 07:27:17 -08:00
fixedmath
gdbstub gdbstub: Minor style fix 2024-06-26 10:19:14 -03:00
gpsutils libs/libc: adapt the cmake script from the makefile 2023-11-07 17:39:03 +01:00
grp
hex2bin
inttypes libs/libc/inttypes: add support for imaxdiv 2024-04-23 10:26:48 -03:00
kbin
libgen
locale Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale). 2024-04-29 17:34:10 +08:00
lzf
machine cmake:bugfix enable ARCH_STRING_FUNCTION CMake build fail 2024-08-14 20:58:59 +08:00
misc idr:Tool for associating discrete ids with addresses 2024-08-19 11:05:40 -03:00
modlib greenhills: fix the moblib asm compile error 2024-08-11 14:28:12 -03:00
net libc/net: Fix indent issue in lib_base64.c 2024-07-27 03:11:39 +08:00
netdb netdb: When set a dns nameserver, if the nameserver already exists, retrun OK. 2023-10-12 12:22:16 +08:00
obstack compiler/tasking: fix compiler warning on tasking 2024-01-31 05:02:56 -08:00
pthread libs: fix the default value of process-shared attribute 2024-08-18 19:44:56 +08:00
pwd build: Fix libc/pwd CMakeLists.txt 2024-08-07 08:45:19 +08:00
queue
regex Replace all asserts in kernel code with ASSERT 2024-05-17 10:18:16 -03:00
sched task/pthread_cancelpt: Move cancel point handling to libc, data to TLS 2023-11-15 08:52:04 -08:00
search hsearch_r: add DELETE action 2024-02-21 13:29:36 -03:00
semaphore sem_open: return error code, sem returned by parameter 2024-06-06 02:40:50 +08:00
signal
spawn cmake: fix compilation 2024-06-02 09:27:36 -03:00
stdio toolchain/ghs: Fix green hills toolchain build Vela MIN_MANT error 2024-08-19 10:37:54 +08:00
stdlib mkstemp: permission 0666 to 0600 2024-07-02 02:56:05 +08:00
stream libc/stream: add file out stream 2023-12-25 16:54:16 -03:00
string libc:add missing source to fix windows build error 2024-08-14 22:36:57 +08:00
symtab libs: fix the problem that the address obtained in thumb mode cannot be executed. 2024-01-04 09:22:57 -08:00
syslog
termios
time libc: Change errno to set_errno and get_errno 2023-10-29 17:16:09 +02:00
tls sched/tls: inline group info in flat mode to improve performance 2024-03-01 17:27:26 +08:00
uio
unistd getrlimit:implement RLIMIT_STACK return limit stack size 2024-08-19 19:55:59 +08:00
userfs
uuid libc: Change errno to set_errno and get_errno 2023-10-29 17:16:09 +02:00
wchar libs/libc/wchar: add wcswidth implementation 2023-09-22 08:51:07 +08:00
wctype compiler/tasking: fix unreachable code on tasking toolchain 2024-01-30 20:53:00 -08:00
wqueue semaphore/_SEM_XX: Remove the _SEM redirection macros as unnecessary 2023-11-27 04:52:54 -08:00
zoneinfo Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
.gitignore
CMakeLists.txt
Kconfig
libc.csv pthread: add pthread_self/pthread_gettid_np function 2024-06-26 17:40:55 +08:00
libc.h stdio: Implement [clearerr|putc|fflush]_unlocked 2023-10-29 17:09:18 +02:00
Makefile api: add simple hashtable api 2024-02-21 13:29:36 -03:00