Hi,
I have to fiddle around with boxing and unboxing of Floating Point numbers in a
64 bit linux kernel. I am truly a noobie with regards to the kernel code.
Unboxed :
double myDouble = 0.0;
double totalTime = 0.0 ;
while(loop a billion times)
{
myDouble = myDouble + myDouble;
}
Here Linux Virtual Memory Manager (LVMM) stores myDouble as an "Immediate data".
Boxed :
object obj = (double)0.0;
double myDouble = 0.0;
while(loop a billion times)
{
obj = (double)obj + myDouble;
}
Here LVMM stores myDouble in the memory is represented by a pointer into the
heap. It has been "Boxed".
Now, my interest here is to inject a different memory allocation technique in
place of the heap allocation done for the Boxed case. Say I want' to allocate
it in Stack for example. Now, after this the allocation for boxing is always to
happen in the Stack instead of the heap (just for an example). I have to figure
out where in the Kernel sources such a technique can be injected.
I was looking into kernel/mm/vmalloc.c and kernel/mm/memory.c but couldn't get a
clue. If someone could help me understand how the memory allocation happens and
what all kernel code gets executed for the above two code snippets, I would be
glad to know.
Any help is highly appreciated. Thanks in advance.
Regards,
-regmee
I have to fiddle around with boxing and unboxing of Floating Point numbers in a
64 bit linux kernel. I am truly a noobie with regards to the kernel code.
Unboxed :
double myDouble = 0.0;
double totalTime = 0.0 ;
while(loop a billion times)
{
myDouble = myDouble + myDouble;
}
Here Linux Virtual Memory Manager (LVMM) stores myDouble as an "Immediate data".
Boxed :
object obj = (double)0.0;
double myDouble = 0.0;
while(loop a billion times)
{
obj = (double)obj + myDouble;
}
Here LVMM stores myDouble in the memory is represented by a pointer into the
heap. It has been "Boxed".
Now, my interest here is to inject a different memory allocation technique in
place of the heap allocation done for the Boxed case. Say I want' to allocate
it in Stack for example. Now, after this the allocation for boxing is always to
happen in the Stack instead of the heap (just for an example). I have to figure
out where in the Kernel sources such a technique can be injected.
I was looking into kernel/mm/vmalloc.c and kernel/mm/memory.c but couldn't get a
clue. If someone could help me understand how the memory allocation happens and
what all kernel code gets executed for the above two code snippets, I would be
glad to know.
Any help is highly appreciated. Thanks in advance.
Regards,
-regmee