Skip to contentSkip to conversation

newbie heap usage problem

Xenomai-help S. ancelot 2 participants 2 messages Jan 11, 2006

lore
Share & tools
lore

S. ancelot

author
#0 lore raw

Hi,
I tried to make a programming sample using heap .
The heap seems to be created regarding registry in proc, but then the program seg faults

Here is my program

#include <sys/mman.h>
#include <xenomai/native/heap.h>
#include <stdio.h>

RT_HEAP *m;
int x;

int main()
{
mlockall(MCL_CURRENT|MCL_FUTURE);
x = rt_heap_create(m,"toto",100,H_SHARED);
rt_heap_delete(m);
return 0;

}

Best Regards
S@

#1 lore raw
Quoted 11 lines · S. ancelot

Hi,
I tried to make a programming sample using heap .
The heap seems to be created regarding registry in proc, but then the program seg faults

Here is my program

#include <sys/mman.h>
#include <xenomai/native/heap.h>
#include <stdio.h>

- RT_HEAP *m;
+ RT_HEAP m;

Quoted 5 lines

int x;

int main()
{
mlockall(MCL_CURRENT|MCL_FUTURE);

- x = rt_heap_create(m,"toto",100,H_SHARED);
- rt_heap_delete(m);
+ x = rt_heap_create(&m,"toto",100,H_SHARED);
+ rt_heap_delete(&m);

Quoted 12 lines

return 0;

}

Best Regards
S@

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.