1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mtune=xscale" } */
4 typedef unsigned int size_t;
5 typedef short unsigned int __uint16_t
;
6 typedef long unsigned int __uint32_t
;
7 typedef unsigned int __uintptr_t
;
8 typedef __uint16_t
uint16_t ;
9 typedef __uint32_t
uint32_t ;
10 typedef __uintptr_t
uintptr_t;
11 typedef uint32_t Objects_Id
;
12 typedef uint16_t Objects_Maximum
;
13 typedef struct { } Objects_Control
;
15 static __inline__
void *_Addresses_Align_up (void *address
, size_t alignment
)
17 uintptr_t mask
= alignment
- (uintptr_t)1;
18 return (void*)(((uintptr_t)address
+ mask
) & ~mask
);
22 Objects_Id minimum_id
;
23 Objects_Maximum maximum
;
26 Objects_Maximum allocation_size
;
28 } Objects_Information
;
30 extern uint32_t _Objects_Get_index (Objects_Id
);
31 extern void** _Workspace_Allocate (size_t);
33 void _Objects_Extend_information (Objects_Information
*information
)
36 uint32_t minimum_index
;
41 minimum_index
= _Objects_Get_index( information
->minimum_id
);
42 if ( information
->object_blocks
==
47 block_count
= information
->maximum
/ information
->allocation_size
;
51 uintptr_t object_blocks_size
;
52 uintptr_t inactive_per_block_size
;
53 object_blocks_size
= (uintptr_t)_Addresses_Align_up(
54 (void*)(block_count
* sizeof(void*)),
57 inactive_per_block_size
=
58 (uintptr_t)_Addresses_Align_up(
59 (void*)(block_count
* sizeof(uint32_t)),
62 block_size
= object_blocks_size
+ inactive_per_block_size
+
63 ((maximum
+ minimum_index
) * sizeof(Objects_Control
*));
64 if ( information
->auto_extend
) {
65 object_blocks
= _Workspace_Allocate( block_size
);