I am not sure about two things: 1) I need address of asm runtime.callbackasm in ...
10 years, 6 months ago
(2014-08-22 05:41:36 UTC)
#2
I am not sure about two things:
1) I need address of asm runtime.callbackasm in Go. I have written
runtime.callbackasmaddr_m for that. Perhaps there is an easier way;
2) I need to allocate some memory in Go, so I have used runtime.gomallocgc. I
hope it is OK.
Alex
On 2014/08/22 05:41:36, brainman wrote: > I am not sure about two things: > > ...
10 years, 6 months ago
(2014-08-22 06:06:50 UTC)
#3
On 2014/08/22 05:41:36, brainman wrote:
> I am not sure about two things:
>
> 1) I need address of asm runtime.callbackasm in Go. I have written
> runtime.callbackasmaddr_m for that. Perhaps there is an easier way;
>
> 2) I need to allocate some memory in Go, so I have used runtime.gomallocgc. I
> hope it is OK.
>
> Alex
For 2), do you have any reason to not use "c := new(wincallbackcontext)" ? Do
you want the allocated memory hidden to the GC ?
On 2014/08/22 06:06:50, remyoudompheng wrote: > > ... do you have any reason to not ...
10 years, 6 months ago
(2014-08-22 06:15:02 UTC)
#4
On 2014/08/22 06:06:50, remyoudompheng wrote:
>
> ... do you have any reason to not use "c := new(wincallbackcontext)" ? Do
> you want the allocated memory hidden to the GC ?
I don't think so. This memory is used by Go runtime to route callbacks from
windows dlls to correct Go functions. I tried "c := &wincallbackcontext{...}"
first, but I got compiler error saying that c escapes to the heap, and that is
illegal in runtime. I don't know why ...
Alex
2014-08-22 8:15 GMT+02:00 <alex.brainman@gmail.com>: > On 2014/08/22 06:06:50, remyoudompheng wrote: > >> ... do you ...
10 years, 6 months ago
(2014-08-22 06:16:29 UTC)
#5
2014-08-22 8:15 GMT+02:00 <alex.brainman@gmail.com>:
> On 2014/08/22 06:06:50, remyoudompheng wrote:
>
>> ... do you have any reason to not use "c := new(wincallbackcontext)" ?
>
> Do
>>
>> you want the allocated memory hidden to the GC ?
>
>
> I don't think so. This memory is used by Go runtime to route callbacks
> from windows dlls to correct Go functions. I tried "c :=
> &wincallbackcontext{...}" first, but I got compiler error saying that c
> escapes to the heap, and that is illegal in runtime. I don't know why
> ...
>
The Go dialect used in runtime disallows implicit heap allocation but
IIRC explicit allocation with new or make is allowed.
Rémy.
On 2014/08/22 06:16:29, remyoudompheng wrote: > explicit allocation with new or make is allowed. Yes, ...
10 years, 6 months ago
(2014-08-22 07:00:15 UTC)
#6
On 2014/08/22 06:16:29, remyoudompheng wrote:
> explicit allocation with new or make is allowed.
Yes, new works. I have changed my code. Thank you.
Alex
*** Submitted as https://code.google.com/p/go/source/detail?r=7cc7cc1bc855 *** runtime: convert NewCallback and NewCallbackCDecl to Go LGTM=khr R=khr, remyoudompheng ...
10 years, 6 months ago
(2014-08-25 05:59:22 UTC)
#9
Issue 132820043: code review 132820043: runtime: convert NewCallback and NewCallbackCDecl to Go
(Closed)
Created 10 years, 6 months ago by brainman
Modified 10 years, 6 months ago
Reviewers:
Base URL:
Comments: 6