Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 251:677f6a0ee643 r20-5b24
Import from CVS: tag r20-5b24
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:19:59 +0200 |
parents | 83b3d10dcba9 |
children | 084402c475ba |
comparison
equal
deleted
inserted
replaced
250:f385a461c9aa | 251:677f6a0ee643 |
---|---|
175 #endif /* VIRT_ADDR_VARIES */ | 175 #endif /* VIRT_ADDR_VARIES */ |
176 EMACS_INT malloc_sbrk_unused; | 176 EMACS_INT malloc_sbrk_unused; |
177 | 177 |
178 /* Non-zero means defun should do purecopy on the function definition */ | 178 /* Non-zero means defun should do purecopy on the function definition */ |
179 int purify_flag; | 179 int purify_flag; |
180 | |
181 #ifdef HEAP_IN_DATA | |
182 extern void sheap_adjust_h(); | |
183 #endif | |
180 | 184 |
181 extern Lisp_Object pure[];/* moved to pure.c to speed incremental linking */ | 185 extern Lisp_Object pure[];/* moved to pure.c to speed incremental linking */ |
182 | 186 |
183 #define PUREBEG ((unsigned char *) pure) | 187 #define PUREBEG ((unsigned char *) pure) |
184 | 188 |
2801 * that is referenced by a pure object. All such | 2805 * that is referenced by a pure object. All such |
2802 * symbols are stored in the hashtable pointed to by | 2806 * symbols are stored in the hashtable pointed to by |
2803 * Vpure_uninterned_symbol_table, which is itself | 2807 * Vpure_uninterned_symbol_table, which is itself |
2804 * staticpro'd. | 2808 * staticpro'd. |
2805 */ | 2809 */ |
2806 if (EQ (XSYMBOL (obj)->obarray, Vobarray)) | 2810 if (!NILP (XSYMBOL (obj)->obarray)) |
2807 return obj; | 2811 return obj; |
2808 Fputhash (obj, obj, Vpure_uninterned_symbol_table); | 2812 Fputhash (obj, obj, Vpure_uninterned_symbol_table); |
2809 return obj; | 2813 return obj; |
2810 } | 2814 } |
2811 else | 2815 else |
2846 "\tPurespace usage: %ld of %ld\n" | 2850 "\tPurespace usage: %ld of %ld\n" |
2847 "****", | 2851 "****", |
2848 get_PURESIZE()+pure_lossage, (long) get_PURESIZE()); | 2852 get_PURESIZE()+pure_lossage, (long) get_PURESIZE()); |
2849 if (die_if_pure_storage_exceeded) { | 2853 if (die_if_pure_storage_exceeded) { |
2850 puresize_adjust_h (get_PURESIZE() + pure_lossage); | 2854 puresize_adjust_h (get_PURESIZE() + pure_lossage); |
2855 #ifdef HEAP_IN_DATA | |
2856 sheap_adjust_h(); | |
2857 #endif | |
2851 rc = -1; | 2858 rc = -1; |
2852 } | 2859 } |
2853 } | 2860 } |
2854 else | 2861 else |
2855 { | 2862 { |
2856 int lost = (get_PURESIZE() - pureptr) / 1024; | 2863 int lost = (get_PURESIZE() - pureptr) / 1024; |
2857 char buf[200]; | 2864 char buf[200]; |
2858 extern Lisp_Object Vemacs_beta_version; | 2865 /* extern Lisp_Object Vemacs_beta_version; */ |
2859 /* This used to be NILP(Vemacs_beta_version) ? 512 : 4; */ | 2866 /* This used to be NILP(Vemacs_beta_version) ? 512 : 4; */ |
2860 #ifndef PURESIZE_SLOP | 2867 #ifndef PURESIZE_SLOP |
2861 #define PURESIZE_SLOP 0 | 2868 #define PURESIZE_SLOP 0 |
2862 #endif | 2869 #endif |
2863 int slop = PURESIZE_SLOP; | 2870 int slop = PURESIZE_SLOP; |
2867 (int) (pureptr / (get_PURESIZE() / 100.0) + 0.5)); | 2874 (int) (pureptr / (get_PURESIZE() / 100.0) + 0.5)); |
2868 if (lost > ((slop ? slop : 1) / 1024)) { | 2875 if (lost > ((slop ? slop : 1) / 1024)) { |
2869 sprintf (buf + strlen (buf), " -- %dk wasted", lost); | 2876 sprintf (buf + strlen (buf), " -- %dk wasted", lost); |
2870 if (die_if_pure_storage_exceeded) { | 2877 if (die_if_pure_storage_exceeded) { |
2871 puresize_adjust_h (pureptr + slop); | 2878 puresize_adjust_h (pureptr + slop); |
2879 #ifdef HEAP_IN_DATA | |
2880 sheap_adjust_h(); | |
2881 #endif | |
2872 rc = -1; | 2882 rc = -1; |
2873 } | 2883 } |
2874 } | 2884 } |
2875 | 2885 |
2876 strcat (buf, ")."); | 2886 strcat (buf, ")."); |