Guest User

Untitled

a guest
Feb 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. (set malloc (NuBridgedFunction functionWithName:"malloc" signature:"li"))
  2. (set memset (NuBridgedFunction functionWithName:"memset" signature:"llil"))
  3.  
  4. (set getchar (NuBridgedFunction functionWithName:"getchar" signature:"i"))
  5.  
  6. ;; Allocate in 100MB chunks...
  7. (set bytecount (* 1024 1024 100))
  8. (set iterations 10)
  9.  
  10. (set i 0)
  11. (while (< i iterations)
  12. (set ptr (malloc bytecount))
  13. (memset ptr 1 bytecount)
  14. (puts "Allocating #{bytecount} bytes: #{ptr}")
  15. (set i (+ i 1)))
  16.  
  17. (getchar)
Add Comment
Please, Sign In to add comment