Commit graph

8 commits

Author SHA1 Message Date
Andrei Alexeyev
8b37d1cbf2
src: the great #include massacre of 2024 2024-05-17 14:11:48 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
3dc0faec9e
renderer/api: rename ClearBufferFlags to BufferKindFlags 2023-04-10 06:47:55 +02:00
Andrei Alexeyev
b6978178b1
memory: use custom memory allocation wrappers
Introduces wrappers around memory allocation functions in `memory.h`
that should be used instead of the standard C ones.

These never return NULL and, with the exception of `mem_realloc()`,
zero-initialize the allocated memory like `calloc()` does.

All allocations made with the memory.h API must be deallocated with
`mem_free()`. Although standard `free()` will work on some platforms,
it's not portable (currently it won't work on Windows). Likewise,
`mem_free()` must not be used to free foreign allocations.

The standard C allocation functions are now diagnosed as deprecated.
They are, however, available with the `libc_` prefix in case interfacing
with foreign APIs is required. So far they are only used to implement
`memory.h`.

Perhaps the most important change is the introduction of the `ALLOC()`,
`ALLOC_ARRAY()`, and `ALLOC_FLEX()` macros. They take a type as a
parameter, and allocate enough memory with the correct alignment for
that type. That includes overaligned types as well. In most
circumstances you should prefer to use these macros. See the `memory.h`
header for some usage examples.
2023-01-18 13:23:22 +01:00
Andrei Alexeyev
4d8470b0c5
fbmgr: add common resize strategy for screen-sized framebuffers 2021-04-13 20:17:30 +03:00
Andrei Alexeyev
3fc75a4bbd
Add stage_add_static_framebuffer
Register a stagedraw-managed framebuffer with static size
2020-04-25 03:04:33 +03:00
makise-homura
f9f1f41991 Fix for strange behavior of elbrus compiler regarding __auto_type
On `__auto_type x = y`, it creates x as array rather than pointer
if y is array, while gcc always makes x a pointer.
2020-01-24 02:33:14 +03:00
Andrei Alexeyev
2e9904e83c
New system to manage auto-resized framebuffers 2019-08-25 02:52:39 +03:00