X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fruntime%2Fprofiling%2FIndexing.lc;h=f9bfeca12cb5ba630bbcb1ba33266355c7e7b765;hb=967cc47f37cb93a5e2b6df7822c9a646f0428247;hp=927e19961e7842f347b40e2ccfb03f76e56c6928;hpb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;p=ghc-hetmet.git diff --git a/ghc/runtime/profiling/Indexing.lc b/ghc/runtime/profiling/Indexing.lc index 927e199..f9bfeca 100644 --- a/ghc/runtime/profiling/Indexing.lc +++ b/ghc/runtime/profiling/Indexing.lc @@ -1,9 +1,9 @@ -Only have cost centres etc if @USE_COST_CENTRES@ defined +Only have cost centres etc if @PROFILING@ defined \begin{code} #define NULL_REG_MAP /* Not threaded */ -#include "../storage/SMinternal.h" /* for xmalloc */ -#if defined (USE_COST_CENTRES) +#include "../storage/SMinternal.h" /* for ??? */ +#if defined (PROFILING) \end{code} %************************************************************************ @@ -40,8 +40,10 @@ init_index_cc() max_cc_no = max2; mask_cc = max2 - 1; - index_cc_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre)); - for (count = 0; count < max2; count++) index_cc_table[count] = 0; + index_cc_table = (CostCentre *) stgMallocBytes(max2 * sizeof(CostCentre), "init_index_cc"); + + for (count = 0; count < max2; count++) + index_cc_table[count] = 0; return max2; } @@ -95,13 +97,16 @@ init_index_mod() max_mod_no = max2; mask_mod = max2 - 1; - index_mod_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre)); - for (count = 0; count < max2; count++) index_mod_table[count] = 0; + index_mod_table = (CostCentre *) stgMallocBytes(max2 * sizeof(CostCentre), "init_index_mod"); + + for (count = 0; count < max2; count++) + index_mod_table[count] = 0; return max2; } -hash_t index_mod(cc) +hash_t +index_mod(cc) CostCentre cc; { if (cc->index_val == UNHASHED) { @@ -152,13 +157,16 @@ init_index_grp() max_grp_no = max2; mask_grp = max2 - 1; - index_grp_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre)); - for (count = 0; count < max2; count++) index_grp_table[count] = 0; + index_grp_table = (CostCentre *) stgMallocBytes(max2 * sizeof(CostCentre), "init_index_grp"); + + for (count = 0; count < max2; count++) + index_grp_table[count] = 0; return max2; } -hash_t index_grp(cc) +hash_t +index_grp(cc) CostCentre cc; { if (cc->index_val == UNHASHED) { @@ -209,13 +217,16 @@ init_index_descr() max_descr_no = max2; mask_descr = max2 - 1; - index_descr_table = (ClCategory *) xmalloc(max2 * sizeof(ClCategory)); - for (count = 0; count < max2; count++) index_descr_table[count] = 0; + index_descr_table = (ClCategory *) stgMallocBytes(max2 * sizeof(ClCategory), "init_index_descr"); + + for (count = 0; count < max2; count++) + index_descr_table[count] = 0; return max2; } -hash_t index_descr(clcat) +hash_t +index_descr(clcat) ClCategory clcat; { if (clcat->index_val == UNHASHED) { @@ -266,8 +277,10 @@ init_index_type() max_type_no = max2; mask_type = max2 - 1; - index_type_table = (ClCategory *) xmalloc(max2 * sizeof(ClCategory)); - for (count = 0; count < max2; count++) index_type_table[count] = 0; + index_type_table = (ClCategory *) stgMallocBytes(max2 * sizeof(ClCategory), "init_index_type"); + + for (count = 0; count < max2; count++) + index_type_table[count] = 0; return max2; } @@ -297,5 +310,5 @@ hash_t index_type(clcat) \end{code} \begin{code} -#endif /* USE_COST_CENTRES */ +#endif /* PROFILING */ \end{code}