29 lines
1 KiB
C
29 lines
1 KiB
C
/* Calcite, include/calcite/memory.h
|
|
* Copyright 2025-2026 Benji Dial
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
void *heap_alloc(uint64_t bytes);
|
|
|
|
//start should be something returned from heap_alloc,
|
|
//unless this is called (carefully) from inside memory.c
|
|
void heap_dealloc(void *start, uint64_t bytes);
|
|
|
|
void memcpy(void *to, const void *from, uint64_t bytes);
|
|
void memset(void *start, uint8_t value, uint64_t length);
|