-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52f12c6
commit d767828
Showing
7 changed files
with
37 additions
and
2 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
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 @@ | ||
fn main() { | ||
var intpointer: Int = memalloc(64); | ||
println("We vibin"); | ||
assignrefi(intpointer, 10); | ||
println("Still vibin"); | ||
var derefd: Int = drefi(intpointer); | ||
print("Val of drefd: "); | ||
println(istr(derefd)); | ||
} |
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 |
---|---|---|
|
@@ -556,6 +556,7 @@ impl<'ctx> Codegen<'ctx> { | |
"", | ||
) | ||
}; | ||
|
||
self.builder.build_store(value_ptr, value); | ||
} | ||
|
||
|
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,20 @@ | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
char *heap[100000]; | ||
int heaploc = 0; | ||
|
||
int memalloc(int size) { | ||
const int chunk = heaploc; | ||
heap[heaploc++] = malloc(size); | ||
printf("MEMALLOC: heap[%d]\n", chunk); | ||
return chunk; | ||
} | ||
int drefi(int loc) { | ||
printf("DREF: *heap[%d] = %d\n", loc, *heap[loc]); | ||
return *heap[loc]; | ||
} | ||
void assignrefi(int loc, int num) { | ||
*heap[loc] = num; | ||
printf("ASSREF: *heap[%d] = %d\n", loc, *heap[loc]); | ||
} |
Empty file.