Skip to content

Commit

Permalink
Adds casts for realloc too
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Jul 11, 2024
1 parent 6761bfa commit ece52f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dyad/common/dyad_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extern "C" {
free(cali_updated_entries_##name);
#define DYAD_C_REGION_UPDATE_INT(name, key, value) \
if (num_current_cali_updates_##name >= cali_updated_entries_##name##_capacity) { \
cali_id_t* realloced_buffer_for_region_##name = realloc(cali_updated_entries_##name, 2 * cali_updated_entries_##name##_capacity * sizeof(cali_id_t)); \
cali_id_t* realloced_buffer_for_region_##name = (cali_id_t*) realloc(cali_updated_entries_##name, 2 * cali_updated_entries_##name##_capacity * sizeof(cali_id_t)); \
if (realloced_buffer_for_region_##name != NULL) { \
cali_updated_entries_##name = realloced_buffer_for_region_##name; \
cali_updated_entries_##name##_capacity *= 2; \
Expand All @@ -108,7 +108,7 @@ extern "C" {
}
#define DYAD_C_REGION_UPDATE_STR(name, key, value) \
if (num_current_cali_updates_##name >= cali_updated_entires_##name##_capacity) { \
cali_id_t* realloced_buffer_for_region_##name = realloc(cali_updated_entries_##name, 2 * cali_updated_entries_##name##_capacity * sizeof(cali_id_t)); \
cali_id_t* realloced_buffer_for_region_##name = (cali_id_t*) realloc(cali_updated_entries_##name, 2 * cali_updated_entries_##name##_capacity * sizeof(cali_id_t)); \
if (realloced_buffer_for_region_##name != NULL) { \
cali_updated_entries_##name = realloced_buffer_for_region_##name; \
cali_updated_entries_##name##_capacity *= 2; \
Expand All @@ -133,7 +133,7 @@ extern "C" {
free(cali_updated_entries_fn);
#define DYAD_C_FUNCTION_UPDATE_INT(key, value) \
if (num_current_cali_updates_fn >= cali_updated_entries_fn_capacity) { \
cali_id_t* realloced_buffer_for_region_fn = realloc(cali_updated_entries_fn, 2 * cali_updated_entries_fn_capacity * sizeof(cali_id_t)); \
cali_id_t* realloced_buffer_for_region_fn = (cali_id_t*) realloc(cali_updated_entries_fn, 2 * cali_updated_entries_fn_capacity * sizeof(cali_id_t)); \
if (realloced_buffer_for_region_fn != NULL) { \
cali_updated_entries_fn = realloced_buffer_for_region_fn; \
cali_updated_entries_fn_capacity *= 2; \
Expand All @@ -147,7 +147,7 @@ extern "C" {
}
#define DYAD_C_FUNCTION_UPDATE_STR(key, value) \
if (num_current_cali_updates_fn >= cali_updated_entries_fn_capacity) { \
cali_id_t* realloced_buffer_for_region_fn = realloc(cali_updated_entries_fn, 2 * cali_updated_entries_fn_capacity * sizeof(cali_id_t)); \
cali_id_t* realloced_buffer_for_region_fn = (cali_id_t*) realloc(cali_updated_entries_fn, 2 * cali_updated_entries_fn_capacity * sizeof(cali_id_t)); \
if (realloced_buffer_for_region_fn != NULL) { \
cali_updated_entries_fn = realloced_buffer_for_region_fn; \
cali_updated_entries_fn_capacity *= 2; \
Expand Down

0 comments on commit ece52f4

Please sign in to comment.