mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
a76a1322eb
Written by Volkmar Frinken (@vfrinken). This is intended as a lightweight (i.e. minimal dependencies) code generator that can be ported to multiple platforms, especially those with memory constraints. It shouldn't be expected to be anywhere near as fast as the Scheme back end, for lots of reasons. The main goal is portability.
29 lines
806 B
C
29 lines
806 B
C
#ifndef __MEMORY_MANAGEMENT_H__
|
|
#define __MEMORY_MANAGEMENT_H__
|
|
#include "cBackend.h"
|
|
|
|
Value *newValue(void);
|
|
Value *newReference(Value *source);
|
|
void removeReference(Value *source);
|
|
|
|
Value_Arglist *newArglist(int missing, int total);
|
|
Value_Constructor *newConstructor(int total, int tag, const char *name);
|
|
|
|
// copies arglist, no pointer bending
|
|
Value_Closure *makeClosureFromArglist(fun_ptr_t f, Value_Arglist *);
|
|
|
|
Value_Double *makeDouble(double d);
|
|
Value_Char *makeChar(char d);
|
|
Value_Int8 *makeInt8(int8_t i);
|
|
Value_Int16 *makeInt16(int16_t i);
|
|
Value_Int32 *makeInt32(int32_t i);
|
|
Value_Int64 *makeInt64(int64_t i);
|
|
Value_String *makeEmptyString(size_t l);
|
|
Value_String *makeString(char *);
|
|
|
|
Value_Pointer *makePointer(void *);
|
|
Value_Array *makeArray(int length);
|
|
Value_World *makeWorld(void);
|
|
|
|
#endif
|