[go: nahoru, domu]

Skip to content

Commit

Permalink
some polish.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxg committed Jan 6, 2019
1 parent 49d93f7 commit f568a4b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nlopt/docs/unsafe.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ directly pass structured client data. This can be done using an extra layer of
indirection. The following code, without commentary, shows what changes
to the above code that supports creating a safe block of memory that points to
a traditional Racket struct to support the retrieval of client data.
Note that this code only works for versions of Racket after Version 7.1 due to
a since-fixed bug in the memory allocator.

@margin-note{
Note that the @racket['interior] option to @racket[malloc] only works for
versions of Racket after Version 7.1 due to a bug in the memory allocator.}

@racketblock[
(define (cbox s)
(define ptr (malloc _racket 'atomic-interior))
(define ptr (malloc _racket 'interior))
(ptr-set! ptr _racket s)
ptr)

Expand Down

0 comments on commit f568a4b

Please sign in to comment.