Removed the freeMemory() pointer from EngineNode

This commit is contained in:
2022-11-26 16:43:42 +00:00
parent f132ca6937
commit 76ae858621
2 changed files with 6 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ static void freeMemory(void* ptr) {
void initEngineNode(EngineNode* node, Interpreter* interpreter, void* tb, size_t size) {
//init
node->freeMemory = freeMemory;
// node->freeMemory = freeMemory;
node->functions = ALLOCATE(LiteralDictionary, 1);
node->parent = NULL;
node->tag = OPAQUE_TAG_ENGINE_NODE;
@@ -96,7 +96,8 @@ void freeEngineNode(EngineNode* node) {
}
//free this node's memory
node->freeMemory(node);
// node->freeMemory(node);
freeMemory(node);
}
Literal callEngineNodeLiteral(EngineNode* node, Interpreter* interpreter, Literal key, LiteralArray* args) {

View File

@@ -9,12 +9,12 @@
//forward declare
typedef struct _engineNode EngineNode;
typedef void (*EngineNodeCallback)(void*);
// typedef void (*EngineNodeCallback)(void*);
//the node object, which forms a tree
typedef struct _engineNode {
//function for releasing memory
EngineNodeCallback freeMemory; //TODO: remove this, not needed
//function for releasing memory NOTE: removed, because it's not needed with only 1 node type - I've left them commented out because I might need them soon
// EngineNodeCallback freeMemory;
//toy functions, stored in a dict for flexibility
LiteralDictionary* functions;