-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nimony: implement build
+ mimalloc support
#383
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6cdccb4
nimony: implement `build` + mimalloc support
ringabout 99424e0
adds `--experimental:strictdefs
ringabout 743f4bb
escapes `customArgs`
ringabout 0b2b7b4
check windows gcc version
ringabout 4ce746e
fixes ERROR_COMMITMENT_MINIMUM
ringabout 59d5af5
Merge branch 'master' into pr_build
ringabout 4e4fed8
remove submodule
ringabout 7b1f1e2
Merge branch 'pr_build' of https://github.com/nim-lang/nif into pr_build
ringabout 6f7e86c
adds `nim-lang/mimalloc`
ringabout 6d2b652
move procs to semos
ringabout File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,3 @@ | ||
[submodule "vendor/mimalloc"] | ||
path = vendor/mimalloc | ||
url = https://github.com/nim-lang/mimalloc |
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,23 @@ | ||
{.build("C", "${path}/../../../vendor/mimalloc/src/static.c", "-I${path}/../../../vendor/mimalloc/include").} | ||
|
||
type | ||
csize_t* {.importc: "size_t", nodecl.} = uint | ||
|
||
proc mi_malloc(size: csize_t): pointer {.importc: "mi_malloc".} | ||
proc mi_calloc(nmemb: csize_t, size: csize_t): pointer {.importc: "mi_calloc".} | ||
proc mi_realloc(pt: pointer, size: csize_t): pointer {.importc: "mi_realloc".} | ||
proc mi_free(p: pointer) {.importc: "mi_free".} | ||
|
||
proc mi_usable_size(p: pointer): csize_t {.importc: "mi_usable_size".} | ||
|
||
proc alloc*(size: int): pointer = | ||
result = mi_malloc(size.csize_t) | ||
|
||
proc realloc*(p: pointer; size: int): pointer = | ||
result = mi_realloc(p, size.csize_t) | ||
|
||
proc dealloc*(p: pointer) = | ||
mi_free(p) | ||
|
||
proc allocatedSize*(p: pointer): int = | ||
result = int mi_usable_size(p) |
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
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
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
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
(kv MyObject.ptr.object +699) | ||
(kv MyObject.my.sequence +171) | ||
(kv MyObject.sequence.base +127)) | ||
(build) | ||
|
||
) |
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,3 @@ | ||
int myFunc() { | ||
return 12; | ||
} |
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,3 @@ | ||
int myFunc2() { | ||
return 12; | ||
} |
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 @@ | ||
{.build("C", "foo.c").} | ||
{.build("C", "foo1.c", "-fno-strict-aliasing").} | ||
|
||
|
||
proc myFunc(): int {.importc: "myFunc".} | ||
proc myFunc2(): int {.importc: "myFunc2".} | ||
|
||
let s = myFunc() | ||
let s2 = myFunc2() |
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,23 @@ | ||
{.build("C", "${path}/../../../vendor/mimalloc/src/static.c", "-I${path}/../../../vendor/mimalloc/include").} | ||
|
||
type | ||
csize_t* {.importc: "size_t", nodecl.} = uint | ||
|
||
proc mi_malloc(size: csize_t): pointer {.importc: "mi_malloc".} | ||
proc mi_calloc(nmemb: csize_t, size: csize_t): pointer {.importc: "mi_calloc".} | ||
proc mi_realloc(pt: pointer, size: csize_t): pointer {.importc: "mi_realloc".} | ||
proc mi_free(p: pointer) {.importc: "mi_free".} | ||
|
||
proc mi_usable_size(p: pointer): csize_t {.importc: "mi_usable_size".} | ||
|
||
proc alloc*(size: int): pointer = | ||
result = mi_malloc(size.csize_t) | ||
|
||
proc realloc*(p: pointer; size: int): pointer = | ||
result = mi_realloc(p, size.csize_t) | ||
|
||
proc dealloc*(p: pointer) = | ||
mi_free(p) | ||
|
||
proc allocatedSize*(p: pointer): int = | ||
result = int mi_usable_size(p) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not like that... But fine for now.