mirror of
https://codeberg.org/1414codeforge/ubgpsuite.git
synced 2025-06-05 21:29:11 +02:00
[*] Initial commit
This commit is contained in:
35
lonetix/mem.c
Normal file
35
lonetix/mem.c
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
/**
|
||||
* \file mem.c
|
||||
*
|
||||
* `MemOps` interface using `malloc()`, `realloc()` and `free()`.
|
||||
*
|
||||
* \copyright The DoubleFourteen Code Forge (C) All Rights Reserved
|
||||
* \author Lorenzo Cogotti
|
||||
*/
|
||||
|
||||
#include "mem.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static void *Mem_Alloc(void *allocp, size_t nbytes, void *oldp)
|
||||
{
|
||||
USED(allocp);
|
||||
|
||||
return realloc(oldp, nbytes);
|
||||
}
|
||||
|
||||
static void Mem_Free(void *allocp, void *ptr)
|
||||
{
|
||||
USED(allocp);
|
||||
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
static const MemOps mem_stdTable = {
|
||||
Mem_Alloc,
|
||||
Mem_Free
|
||||
};
|
||||
|
||||
const MemOps *const Mem_StdOps = &mem_stdTable;
|
Reference in New Issue
Block a user