6 struct list __based(__self) *next;
\r
10 void main(int argc, char *argv[])
\r
14 void __based(__self) *pee;
\r
15 struct list __based(segu) *head;
\r
16 struct list __based(segu) *p;
\r
18 /* allocate based heap */
\r
19 segu = _bheapseg( 65536 );
\r
20 if( segu == _NULLSEG ) {
\r
21 printf( "Unable to allocate based heap\n" );
\r
25 /* create a linked list in the based heap */
\r
27 for( i = 1; i < 4096; i++ ) {
\r
28 p = _bmalloc( segu, sizeof( struct list ) );
\r
29 if( p == _NULLOFF ) {
\r
30 printf( "_bmalloc failed\n" );
\r
38 /* traverse the linked list, printing out values */
\r
39 for( p = head; p != 0; p = p->next ) {
\r
40 if(p==head || p->next==0 || p==pee){
41 printf("Segu = %04X", p); printf( " Value = %d\n", p->value );
45 printf("program=%FP\n", *argv[0]);
46 printf("seg=%04X\n", segu);
48 /* free all the elements of the linked list */
\r
49 for( ; p = head; ) {
\r
53 /* free the based heap */
\r