C++ bindings needed to use system_allocator's free() too
This commit is contained in:
parent
6bffacefaf
commit
759fbe77e5
2 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@
|
|||
#include <string.h>
|
||||
#include "hammer.h"
|
||||
|
||||
/* "Internal" in this case means "we're not ready to commit
|
||||
* to a public API." Many structures and routines here will be
|
||||
* useful in client programs.
|
||||
*/
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define assert_message(check, message) do { } while(0)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue