-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[xtrace] Implement NativeAllocator & Rework C++ Classes To Use Native…
…Allocator
- Loading branch information
1 parent
3622830
commit b8eb5d2
Showing
7 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ set(xtrace_sources | |
lock.c | ||
posix_spawn_args.c | ||
log.cpp | ||
string.cpp | ||
) | ||
|
||
if (TARGET_x86_64) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "memory.h" | ||
|
||
#include <elfcalls.h> | ||
|
||
extern struct elf_calls* _elfcalls; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "string.h" | ||
|
||
#include <darling/emulation/simple.h> | ||
|
||
xtrace::string xtrace::to_string(int value) { | ||
char tmp[12] = ""; | ||
__simple_snprintf(tmp,sizeof(tmp),"%i",value); | ||
return xtrace::string(tmp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef XTRACE_STRING | ||
#define XTRACE_STRING | ||
|
||
#include "memory.h" | ||
|
||
#ifdef __cplusplus | ||
#include <string> | ||
|
||
namespace xtrace { | ||
typedef std::basic_string<char,std::char_traits<char>,xtrace::NativeAllocator<char>> string; | ||
|
||
string to_string(int value); | ||
} | ||
#endif | ||
|
||
#endif // XTRACE_STRING |