glfw/src
Camilla Löwy 22b586b3d8 Add pluggable heap allocator
This adds the glfwInitAllocator function for specifying a custom memory
allocator to use instead of the C runtime library.

The allocator is a struct of type GLFWallocator with fields
corresponding to malloc, realloc and free, while the internal API
corresponds to calloc, realloc and free.

Heap allocation calls are filtered before reaching the user-provided
functions, so deallocation of NULL and allocations of zero bytes are not
passed on, reallocating NULL is transformed into an allocation and
reallocating to size zero is transformed into deallocation.

The clearing of a new block to zero is performed by the internal
calloc-like function.

Closes #544.
Fixes #1628.
Closes #1947.
2021-08-25 21:00:10 +02:00
..
CMakeLists.txt Add override variable for CMake library type 2021-08-15 22:44:43 +02:00
cocoa_init.m Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
cocoa_joystick.h Add gamepad mapping filtering by backend 2021-08-01 20:17:21 +02:00
cocoa_joystick.m Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
cocoa_monitor.m Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
cocoa_platform.h Cocoa: Fix macro redefinition warning 2021-07-29 21:21:45 +02:00
cocoa_time.c Add C dialect reminders to each source file 2019-05-24 14:43:49 +02:00
cocoa_window.m Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
context.c Move single/double-buffer filtering to backends 2021-05-14 19:02:25 +02:00
egl_context.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
egl_context.h EGL: Fix creation of single-buffered windows 2021-05-14 19:02:25 +02:00
glfw_config.h.in Cocoa: Select Vulkan surface extension at runtime 2020-01-16 21:53:18 +01:00
glfw.rc.in Win32: Add VERSIONINFO resource to GLFW DLL 2019-12-11 21:02:08 +01:00
glx_context.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
glx_context.h Replace some tabs with spaces 2019-06-16 16:57:09 +02:00
init.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
input.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
internal.h Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
linux_joystick.c Cleanup 2020-07-21 17:54:07 +02:00
linux_joystick.h Add gamepad mapping filtering by backend 2021-08-01 20:17:21 +02:00
mappings.h Simplify parsing of default gamepad mappings 2021-08-01 20:57:28 +02:00
mappings.h.in Simplify parsing of default gamepad mappings 2021-08-01 20:57:28 +02:00
monitor.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
nsgl_context.h NSGL: Remove problematic swap interval workaround 2019-12-20 09:46:48 +01:00
nsgl_context.m Cocoa: Fix call to NSWindow from non-main threads 2020-04-30 22:44:54 +02:00
null_init.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
null_joystick.c Make _glfwPlatformInitJoysticks() return the correct type in null_joystick 2020-08-08 22:51:50 +02:00
null_joystick.h Fix -Wextra-semi warnings 2019-10-17 20:09:38 +02:00
null_monitor.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
null_platform.h Remove EGL and OSMesa struct member macros 2020-06-24 00:50:49 +02:00
null_window.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
osmesa_context.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
osmesa_context.h Remove EGL and OSMesa struct member macros 2020-06-24 00:50:49 +02:00
posix_thread.c Add C dialect reminders to each source file 2019-05-24 14:43:49 +02:00
posix_thread.h Start 3.4 2019-04-16 23:08:39 +02:00
posix_time.c POSIX: Use frequency member for clarity 2021-08-13 17:27:38 +02:00
posix_time.h POSIX: Remove use of deprecated gettimeofday 2021-08-13 17:18:56 +02:00
vulkan.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
wgl_context.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
wgl_context.h WGL: Remove unused constants 2020-02-10 17:44:57 +01:00
win32_init.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
win32_joystick.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
win32_joystick.h Add gamepad mapping filtering by backend 2021-08-01 20:17:21 +02:00
win32_monitor.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
win32_platform.h Win32: Remove changing the foreground lock timeout 2021-08-12 20:50:30 +02:00
win32_thread.c Add C dialect reminders to each source file 2019-05-24 14:43:49 +02:00
win32_time.c Add C dialect reminders to each source file 2019-05-24 14:43:49 +02:00
win32_window.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
window.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
wl_init.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
wl_monitor.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
wl_platform.h Wayland: Load functions for new atomic marshalling 2021-08-19 18:55:35 +02:00
wl_window.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
x11_init.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
x11_monitor.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
x11_platform.h X11: Include X Shape extension headers 2020-07-15 18:00:00 +02:00
x11_window.c Add pluggable heap allocator 2021-08-25 21:00:10 +02:00
xkb_unicode.c Add C dialect reminders to each source file 2019-05-24 14:43:49 +02:00
xkb_unicode.h Start 3.4 2019-04-16 23:08:39 +02:00