C++ bindings needed to use system_allocator's free() too

This commit is contained in:
Meredith L. Patterson 2015-08-02 22:03:30 +02:00
parent 6bffacefaf
commit 759fbe77e5
2 changed files with 7 additions and 1 deletions

View file

@ -2,6 +2,7 @@
#define HAMMER_HAMMER__HPP
#include "../../../hammer.h"
#include "../../../internal.h"
#include <string>
#include <stdint.h>
#include <cstdarg>
@ -49,7 +50,7 @@ namespace hammer {
std::string asUnambiguous() {
char* buf = h_write_result_unamb(token);
std::string s = std::string(buf);
free(buf);
(&system_allocator)->free(&system_allocator, buf);
return s;
}
};