Remove explicit calls to free() and malloc().

This commit is contained in:
Bob Nystrom
2013-12-27 09:07:35 -08:00
parent a8c725ea3f
commit afdcafcecb
4 changed files with 45 additions and 49 deletions
+5 -6
View File
@@ -284,20 +284,19 @@ void unpinObj(WrenVM* vm);
// Initializes the symbol table.
void initSymbolTable(SymbolTable* symbols);
// Removes any symbols added after [count] symbols were defined.
void truncateSymbolTable(SymbolTable* symbols, int count);
// Frees all dynamically allocated memory used by the symbol table, but not the
// SymbolTable itself.
void clearSymbolTable(SymbolTable* symbols);
void clearSymbolTable(WrenVM* vm, SymbolTable* symbols);
// Adds name to the symbol table. Returns the index of it in the table. Returns
// -1 if the symbol is already present.
int addSymbol(SymbolTable* symbols, const char* name, size_t length);
int addSymbol(WrenVM* vm, SymbolTable* symbols,
const char* name, size_t length);
// Adds name to the symbol table. Returns the index of it in the table. Will
// use an existing symbol if already present.
int ensureSymbol(SymbolTable* symbols, const char* name, size_t length);
int ensureSymbol(WrenVM* vm, SymbolTable* symbols,
const char* name, size_t length);
// Looks up name in the symbol table. Returns its index if found or -1 if not.
int findSymbol(SymbolTable* symbols, const char* name, size_t length);