Created
March 18, 2014 23:10
-
-
Save danking/9631801 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
#lang racket | |
(require ffi/unsafe | |
ffi/unsafe/custodian) | |
(define n 0) | |
(define (foo) | |
(define 100bytes (malloc 100 'raw)) | |
(define uid n) | |
(set! n (add1 n)) | |
(register-custodian-shutdown 100bytes | |
(lambda (x) | |
(log-error "hello there ~a" uid) | |
(free x))) | |
100bytes) | |
(let ((x (foo)) | |
(y (foo))) | |
0) | |
(define bar (foo)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment