Simple DirectMedia Layer https://libsdl.org
Find a file
Andrei Sabalenka 3146d923e7
hashtable: add generic hashtable
SDL_HashTable uses callbacks to calculate hash, compare keys and destroy items. Compiler doesn't know anything about functions that hashtable is going to call, so some optimizations can't be applied. But in almost all cases we know the functions to be called at compile time.

Generic hashtable is a reusable header that generates hashtable implementation for concrete hash, compare and destroy functions. It allows them to be inlined by the compiler, resulting in 1.5-4x performance boost compared to SDL_HashTable. The implementation is taken from SDL_HashTable, with a few improvements:

- Lowered max load factor to 128 (50%). Seems to be a good default value, as find is unlikely to load more than one cache line. The value also can be overriden by setting SDL_HASHTABLE_MAX_LOAD_FACTOR.

- Removed live bit field, using probe_len = 0 to indicate whether the item is live instead. Seems to be a bit faster, as CPU doesn't need to reset live bit each time probe_len is accessed.

- Removed max_probe_len. Unneeded, as we compare to probe_len of each item we visit, which is a stronger break condition.
2026-06-05 17:20:06 +03:00
.github ci: ignore artifact upload errors 2026-06-05 03:17:42 +02:00
android-project Make initializeDeviceListener() and shutdownDeviceListener() public 2026-06-04 09:26:33 -07:00
build-scripts SDL_migration.cocci: Add joystick/gamepad event state functions. 2026-05-30 14:05:45 -04:00
cmake Revert "vfork() isn't functional on DOS" 2026-06-02 14:16:31 -07:00
docs docs: bump minimum required Android ndk version 2026-05-27 20:05:50 +02:00
examples examples/input/05-gamepad-rumble: add some visual feedback. 2026-06-02 19:50:05 -04:00
include Create a global event lock for hardware that generates events 2026-06-02 16:51:58 -07:00
src hashtable: add generic hashtable 2026-06-05 17:20:06 +03:00
test render: an empty clip rect should clip all drawing 2026-05-29 13:58:34 -07:00
VisualC examples: Added input/05-gamepad-rumble 2026-05-31 08:32:44 -07:00
VisualC-GDK gdk: Update Suspend/Resume best practices. 2026-03-07 11:19:09 -05:00
wayland-protocols revert parts of CodeSpell commit d870911202 from 3rd party sources 2026-05-13 18:00:02 +03:00
Xcode Added curved window mode on visionOS 26 (#15298) 2026-05-12 16:48:06 -07:00
.clang-format Add CHECK_PARAM as a conditional macro in clang-format 2026-04-03 11:47:41 -04:00
.clang-tidy Fix size of memcpy in SDL_AudioDeviceFormatChangedAlreadyLocked 2023-08-05 14:14:45 -04:00
.editorconfig .editorconfig: Remove excess apostrophe at *.cocci 2024-06-16 09:18:17 -07:00
.gitignore Updated .gitignore for png test data 2025-10-10 08:59:27 -07:00
.wikiheaders-options wikiheaders: Generate a current list of supported environment variables. 2025-09-02 15:49:52 -04:00
AGENTS.md AGENTS.md: Change "may not" to "must not". 2026-04-15 17:26:54 -04:00
Android.mk Add SVE2 SIMD Alpha-Blending Blitter (#15504) 2026-05-13 23:37:46 -07:00
BUGS.txt Added a Discord link to BUGS.txt 2025-01-13 16:42:50 -08:00
CLAUDE.md CLAUDE.md: Just copy the text from AGENTS.md in here for now. 2026-04-16 13:51:49 -04:00
CMakeLists.txt cmake: Preseed the CMake cache for Haiku OS. 2026-05-27 15:43:16 -04:00
CREDITS.md Updated the credits for SDL 3.0 2025-01-13 16:42:50 -08:00
INSTALL.md Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
LICENSE.txt Updated copyright for 2026 2026-01-01 09:40:08 -08:00
README.md Revert "Update README.md" 2025-11-16 01:15:10 +03:00
WhatsNew.txt Added SDL_HINT_MOUSE_DPI_SCALE_CURSORS 2025-12-09 17:12:08 -08:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)