handles: use real pointers to keep track of handles #296

Merged
carlosmn merged 1 commits from cmn/track-real-pointers into master 2016-02-18 11:43:56 -06:00

1 Commits

Author SHA1 Message Date
Carlos Martín Nieto f1240e6565 handles: use real pointers to keep track of handles
With the change to 1.6 rules, we couldn't use the Go pointers, so we
went with casting the list indices into pointers.

The runtime does not like this, however. It will sometimes detect that
we have a pointer with a very small value and consider it an invalid
pointer, bringing down the application with it.

Work around that by asking libc for the smallest amount of memory it'll
give us so we have an actual allocated pointer to use. We then use this
pointer value as the key in our map to find the Go object we're
tracking.
2016-02-18 17:33:44 +01:00