what is pike_trampoline_program?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

what is pike_trampoline_program?

郭雪松-2
Hi
 
I'm using Debug.count_objects to find memory leak. I found "program.c:9976":450622 .
 
"program.c:9976" is something named "pike_trampoline_program". What's it?
 
thanks.

Guo Xuesong
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: what is pike_trampoline_program?

郭雪松-2
resolved, It's lambda

Guo Xuesong
 

From: [hidden email]
To: [hidden email]
Subject: what is pike_trampoline_program?
Date: Tue, 3 Jan 2012 02:41:46 +0800

Hi
 
I'm using Debug.count_objects to find memory leak. I found "program.c:9976":450622 .
 
"program.c:9976" is something named "pike_trampoline_program". What's it?
 
thanks.

Guo Xuesong
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: what is pike_trampoline_program?

Henrik Grubbström-2
On Tue, 3 Jan 2012, ¹ùÑ©ËÉ wrote:

> resolved, It's lambda

Correct; to be exact it's lambda's which use local variables from the
function in which they were defined.
eg:

// Uses trampolines, since it needs x from the surrounding scope.
array foo(array a, mixed x)
{
   return map(a, lambda(mixed val) {
     return val || x;
   });
}

// Does not use trampolines.
array bar(array a, mixed x)
{
   return map(a, lambda(mixed val, mixed x) {
     return val || x;
   }, x);
}

> Guo Xuesong
>
>
>
>
> From: [hidden email]
> To: [hidden email]
> Subject: what is pike_trampoline_program?
> Date: Tue, 3 Jan 2012 02:41:46 +0800
>
>
>
>
> Hi
>
> I'm using Debug.count_objects to find memory leak. I found "program.c:9976":450622 .
>
> "program.c:9976" is something named "pike_trampoline_program". What's it?
>
> thanks.
>
> Guo Xuesong
>
--
Henrik Grubbström [hidden email]
Roxen Internet Software AB
Loading...