mirror of
https://github.com/fredrikr79/SnakeDL3.git
synced 2026-07-31 22:53:04 +02:00
arena: move kb macro
This commit is contained in:
@@ -4,8 +4,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define KB(x) x * 1024
|
|
||||||
|
|
||||||
void arena_init(Arena *a, size_t size) {
|
void arena_init(Arena *a, size_t size) {
|
||||||
*a = (Arena){.buffer = malloc(size), .size = size, .offset = 0};
|
*a = (Arena){.buffer = malloc(size), .size = size, .offset = 0};
|
||||||
if (a->buffer == NULL)
|
if (a->buffer == NULL)
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#define KB(x) x * 1024
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *buffer;
|
char *buffer;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|||||||
Reference in New Issue
Block a user