taisei/src/replay
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
..
eventcodes.h stage: add replay-based quicksave/quickload functionality 2022-01-09 14:11:26 +02:00
meson.build replay: general refactor 2021-06-16 01:43:10 +03:00
play.c memory: use custom memory allocation wrappers 2023-01-18 13:23:22 +01:00
read.c memory: use custom memory allocation wrappers 2023-01-18 13:23:22 +01:00
replay.c memory: use custom memory allocation wrappers 2023-01-18 13:23:22 +01:00
replay.h replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
rw_common.c replay: general refactor 2021-06-16 01:43:10 +03:00
rw_common.h replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
stage.c player: refactor power handling 2022-10-03 20:53:22 +02:00
stage.h replay: use dynarray to store stages 2022-01-09 14:03:55 +02:00
state.c replay: general refactor 2021-06-16 01:43:10 +03:00
state.h replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
struct.h replay: use dynarray to store stages 2022-01-09 14:03:55 +02:00
write.c replay: avoid silly gcc7 warning 2022-02-18 07:44:25 +02:00