2 * Copyright (c) 2003 Red Hat, Inc. All rights reserved.
4 * This copyrighted material is made available to anyone wishing to use, modify,
5 * copy, or redistribute it subject to the terms and conditions of the BSD
6 * License. This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY expressed or implied, including the implied
8 * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy
9 * of this license is available at http://www.opensource.org/licenses. Any
10 * Red Hat trademarks that are incorporated in the source code or documentation
11 * are not subject to the BSD License and may only be used or replicated with
12 * the express permission of Red Hat, Inc.
17 extern int __heap __far
; /* beginning of heap */
18 extern int __heap_end __far
; /* if at address 0, use stack pointer as limit */
20 static char *the_break
= (char *)(& __heap
);
23 is_addr_0 (int address
)
25 return address
? 0 : 1;
31 char *current_heap_limit
= (char *) (& __heap_end
);
33 /* is_addr_0 avoids optimizing out this block. */
34 if (is_addr_0 ((int) current_heap_limit
))
38 current_heap_limit
= (char *) (& something
) - margin
;
41 if ((the_break
+ inc
) < current_heap_limit
)
43 void *rv
= (void *) the_break
;