7 struct list __based(__self) *next;
10 struct list _seg *next;
15 void main(int argc, char *argv[])
\r
20 void __based(__self) *pee;
\r
21 struct list __based(segu) *head;
\r
22 struct list __based(segu) *p;
26 struct list _seg *head;
\r
30 /* allocate based heap */
\r
31 segu = _bheapseg( 65536 );
\r
32 if( segu == _NULLSEG ) {
\r
33 printf( "Unable to allocate based heap\n" );
\r
37 /* create a linked list in the based heap */
\r
39 for( i = 1; i < 4096; i++ ) {
\r
40 p = _bmalloc( segu, sizeof( struct list ) );
\r
41 if( p == _NULLOFF ) {
\r
42 printf( "_bmalloc failed\n" );
\r
50 /* traverse the linked list, printing out values */
\r
51 for( p = head; p != 0; p = p->next ) {
\r
52 if(p==head || p->next==0 || p==pee){
53 printf("Segu = %04X", p); printf( " Value = %d\n", p->value );
57 printf("program=%FP\n", *argv[0]);
58 printf("seg=%04X\n", segu);
60 /* free all the elements of the linked list */
\r
61 for( ; p = head; ) {
\r
65 /* free the based heap */
\r