1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:37:44 +00:00
serenity/Userland/Libraries/LibC
Gunnar Beutner f89e8fb71a AK+LibC: Implement malloc_good_size() and use it for Vector/HashTable
This implements the macOS API malloc_good_size() which returns the
true allocation size for a given requested allocation size. This
allows us to make use of all the available memory in a malloc chunk.

For example, for a malloc request of 35 bytes our malloc would
internally use a chunk of size 64, however the remaining 29 bytes
would be unused.

Knowing the true allocation size allows us to request more usable
memory that would otherwise be wasted and make that available for
Vector, HashTable and potentially other callers in the future.
2021-05-15 16:30:14 +02:00
..
arch Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
arpa Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
bits LibC: Move the __pthread_mutex_trylock function to LibC 2021-04-25 10:14:50 +02:00
net LibC: Add definitions/stubs for IPv6 functionality 2021-05-09 21:16:11 +02:00
netinet LibC: Add definitions/stubs for IPv6 functionality 2021-05-09 21:16:11 +02:00
sys Kernel+LibC: Add fstatat 2021-05-14 23:32:10 +02:00
alloca.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
assert.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
assert.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
byteswap.h Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
CMakeLists.txt LibC: Move mman.h to sys/mman.h 2021-05-14 22:24:02 +02:00
crt0.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
crt0_shared.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
crti.S Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
crtn.S Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ctype.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ctype.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
cxxabi.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
dirent.cpp Kernel+LibC: Make get_dir_entries syscall retriable 2021-05-12 12:50:23 +02:00
dirent.h LibC: Implement scandir(...) to enumerate directories. 2021-05-02 13:33:41 +02:00
dlfcn.cpp LibC+LibELF: Implement more fully-features dlfcn functionality 2021-04-25 10:14:50 +02:00
elf.h LibELF: Implement x86_64 relocation support 2021-05-03 08:42:39 +02:00
endian.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
errno.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
errno_numbers.h LibC: Add definition for EDQUOT 2021-05-08 18:11:52 +02:00
fcntl.cpp Userland+LibCore: Update FileWatcher + its users for InodeWatcher 2.0 2021-05-12 22:38:20 +02:00
fcntl.h Kernel+LibC: Add fstatat 2021-05-14 23:32:10 +02:00
fd_set.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
fenv.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
fenv.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
float.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
getopt.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
getopt.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
grp.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
grp.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
iconv.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
inttypes.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
inttypes.h Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
ioctl.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
libcinit.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
libgen.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
libgen.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
limits.h Userland: Move HOST_NAME_MAX to limits.h 2021-04-27 23:06:16 +02:00
link.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
link.h LibELF+LibC: Support building LibELF for 64-bit targets 2021-05-03 08:42:39 +02:00
locale.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
locale.h LibC: Add definition for LC_MESSAGES 2021-05-08 19:14:21 +02:00
malloc.cpp AK+LibC: Implement malloc_good_size() and use it for Vector/HashTable 2021-05-15 16:30:14 +02:00
mallocdefs.h LibC: Lazily initialize malloc chunks 2021-05-06 10:38:46 +02:00
memory.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
mntent.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
mntent.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
net.cpp LibC: Add definitions/stubs for IPv6 functionality 2021-05-09 21:16:11 +02:00
netdb.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
netdb.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
paths.h Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
poll.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
poll.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
pthread_forward.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
pthread_integration.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
pthread_tls.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
pty.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
pty.h LibC: Remove 'int* aslave' parameter from forkpty() 2021-05-06 13:52:46 +01:00
pwd.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
pwd.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
qsort.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
regex.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
scanf.cpp LibC: Make scanf() not increment the assignment count for %n 2021-05-06 20:36:17 +02:00
sched.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
sched.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
serenity.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
serenity.h Kernel+Profiler: Improve profiling subsystem 2021-04-26 17:13:55 +02:00
setjmp.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
shadow.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
shadow.h LibCore: Fix building the library on macOS 2021-05-01 15:56:16 +02:00
signal.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
signal.h LibC: Fix typo in signal.h: ol_dset -> old_set 2021-04-26 11:27:13 +02:00
signal_numbers.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
spawn.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
spawn.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ssp.cpp Everywhere: Use bgianf@serenityos.org for my copyright attribution 2021-04-22 21:15:54 +02:00
stat.cpp Kernel+LibC: Add fstatat 2021-05-14 23:32:10 +02:00
stdarg.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stddef.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stdint.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stdio.cpp LibC: Implement vscanf 2021-05-09 15:35:01 +02:00
stdio.h LibC: Implement vscanf 2021-05-09 15:35:01 +02:00
stdlib.cpp AK: Introduce get_random_uniform() 2021-05-14 22:24:02 +02:00
stdlib.h AK+LibC: Implement malloc_good_size() and use it for Vector/HashTable 2021-05-15 16:30:14 +02:00
string.cpp LibC: Add definition for EDQUOT 2021-05-08 18:11:52 +02:00
string.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
strings.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
strings.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stubs.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
sysexits.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
syslog.cpp LibC: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
syslog.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termcap.cpp Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr 2021-05-01 21:25:06 +02:00
termcap.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termios.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termios.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
time.cpp LibC: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
time.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
times.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ulimit.cpp LibC: Add stubs for getrlimit()/setrlimit() 2021-05-08 19:14:21 +02:00
ulimit.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
unistd.cpp Kernel/LibC: Implement setreuid 2021-04-30 11:35:17 +02:00
unistd.h LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
utime.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utime.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utmp.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utsname.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
wchar.cpp iLibC: Fix some missed camelCase => snake_case 2021-04-29 10:34:02 +02:00
wchar.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00