Testing
This commit is contained in:
@@ -8,7 +8,7 @@ The language is currently **very debuggable**. It can produce readable C code wi
|
|||||||
|
|
||||||
* More examples can be found in /examples and /modules
|
* More examples can be found in /examples and /modules
|
||||||
|
|
||||||
```
|
``` odin
|
||||||
#import "KERNEL32.core"
|
#import "KERNEL32.core"
|
||||||
#import "Base.core"
|
#import "Base.core"
|
||||||
|
|
||||||
@@ -18,12 +18,6 @@ Memory :: struct
|
|||||||
reserve: SizeU
|
reserve: SizeU
|
||||||
data : *U8
|
data : *U8
|
||||||
|
|
||||||
ProcessHeap: HANDLE
|
|
||||||
Allocate :: (size: U64): *void
|
|
||||||
if ProcessHeap == 0
|
|
||||||
ProcessHeap = GetProcessHeap()
|
|
||||||
return HeapAlloc(ProcessHeap, 0, size)
|
|
||||||
|
|
||||||
Reserve :: (size: SizeU): Memory
|
Reserve :: (size: SizeU): Memory
|
||||||
// C like compound expressions with named arguments
|
// C like compound expressions with named arguments
|
||||||
result := Memory{reserve=AlignUp(size, PAGE_SIZE)}
|
result := Memory{reserve=AlignUp(size, PAGE_SIZE)}
|
||||||
@@ -65,6 +59,7 @@ Release :: (m: *Memory)
|
|||||||
## Operator overload example
|
## Operator overload example
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Vec3 :: struct ;; x: F32; y: F32; z: F32
|
||||||
"-" :: (a: Vec3, b: Vec3): Vec3 ;; return {a.x-b.x, a.y-b.y, a.z-b.z}
|
"-" :: (a: Vec3, b: Vec3): Vec3 ;; return {a.x-b.x, a.y-b.y, a.z-b.z}
|
||||||
"-" :: (a: Vec3): Vec3 ;; return {-a.x, -a.y, -a.z }
|
"-" :: (a: Vec3): Vec3 ;; return {-a.x, -a.y, -a.z }
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user