Created
December 5, 2008 01:52
-
-
Save itfrombit/32200 to your computer and use it in GitHub Desktop.
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
(set malloc (NuBridgedFunction functionWithName:"malloc" signature:"li")) | |
(set memset (NuBridgedFunction functionWithName:"memset" signature:"llil")) | |
(set getchar (NuBridgedFunction functionWithName:"getchar" signature:"i")) | |
;; Allocate in 100MB chunks... | |
(set bytecount (* 1024 1024 100)) | |
(set iterations 10) | |
(set i 0) | |
(while (< i iterations) | |
(set ptr (malloc bytecount)) | |
(memset ptr 1 bytecount) | |
(puts "Allocating #{bytecount} bytes: #{ptr}") | |
(set i (+ i 1))) | |
(getchar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment