-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RuntimeLibrary: Add skeleton runtime library
Very basic runtime library. Signed-off-by: Hyeonggon Yoo <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 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
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 @@ | ||
add_library(plsan plsan.cpp) |
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,24 @@ | ||
/* READ THIS: | ||
* The name of a function here must start with double underscores to avoid | ||
* collisons with the program. For example: __foo(), __bar(), etc. | ||
*/ | ||
|
||
#include <cstddef> | ||
|
||
/* Initialization routines called before main() */ | ||
__attribute__((constructor)) void __plsan_init() { /* TODO: */ } | ||
|
||
void __plsan_alloc(void *addr, size_t size) { | ||
/* TODO: initialize references */ | ||
} | ||
|
||
void __plsan_store(void **addr, void *value) { /* TODO: update references */ } | ||
|
||
void __plsan_exit_func() { | ||
/* | ||
* TODO: check if | ||
* 1) the address of lost meomry is written back to memory before | ||
* returning the function | ||
* 2) or the address of a buffer is return value | ||
*/ | ||
} |