[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
_Heap_Allocate_aligned return the same address?
- Date: Wed, 12 Sep 2007 20:32:37 +0400
- From: osv at javad.com (Sergei Organov)
- Subject: _Heap_Allocate_aligned return the same address?
"??" <yanmiaobest at gmail.com> writes:
> Hi,
>
> I am using rtems-4.7.1 on i386-qemu, I called
> _Heap_Allocate_aligned twice, but the return address are the same.
> here is my code:
>
> char buf[4096 * 10];
> #define PAGE_SIZE 4096
> void f()
> {
> Heap_Control the_heap;
> _Heap_Initialize( &the_heap, (void *)buf, 4096 * 10, CPU_ALIGNMENT);
>
> void *p = _Heap_Allocate_aligned( &the_heap, 4096, PAGE_SIZE);
> void *g = _Heap_Allocate_aligned( &the_heap, 4096, PAGE_SIZE);
>
> printf("0x%x\n", p );
> printf("0x%x\n", g );
> }
>
> and the output is:
>
> 0x125000
> 0x125000
>
> is somthing wrong here?
I've created a new PR1258 for this issue:
<https://www.rtems.org/bugzilla/show_bug.cgi?id=1258>
-- Sergei.