Skip to content

Commit

Permalink
common: disable compilation of unneded code
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
  • Loading branch information
grom72 committed Mar 19, 2024
1 parent 75b31ff commit 199e94d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/libpmemobj/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ heap_get_bestfit_block(struct palloc_heap *heap, struct bucket *b,
return 0;
}

#if VG_MEMCHECK_ENABLED
/*
* heap_end -- returns first address after heap
*/
Expand All @@ -1252,6 +1253,7 @@ heap_end(struct palloc_heap *h)

return &last_zone->chunks[last_zone->header.size_idx];
}
#endif /* VG_MEMCHECK_ENABLED */

/*
* heap_arena_create -- create a new arena, push it to the vector
Expand Down
2 changes: 2 additions & 0 deletions src/libpmemobj/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ void heap_foreach_object(struct palloc_heap *heap, object_callback cb,

struct alloc_class_collection *heap_alloc_classes(struct palloc_heap *heap);

#if VG_MEMCHECK_ENABLED
void *heap_end(struct palloc_heap *heap);
#endif /* VG_MEMCHECK_ENABLED */

unsigned heap_get_narenas_total(struct palloc_heap *heap);

Expand Down
2 changes: 1 addition & 1 deletion src/libpmemobj/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ obj_runtime_init(PMEMobjpool *pop, int rdonly, int boot, unsigned nlanes)
VALGRIND_DO_MAKE_MEM_NOACCESS(end,
(char *)pop + pop->set->poolsize - (char *)end);
}
#endif
#endif /* VG_MEMCHECK_ENABLED */

obj_pool_init();

Expand Down
2 changes: 2 additions & 0 deletions src/libpmemobj/palloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,7 @@ palloc_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
return heap_init(heap_start, heap_size, sizep, p_ops);
}

#if VG_MEMCHECK_ENABLED
/*
* palloc_heap_end -- returns first address after heap
*/
Expand All @@ -1287,6 +1288,7 @@ palloc_heap_end(struct palloc_heap *h)
{
return heap_end(h);
}
#endif /* VG_MEMCHECK_ENABLED */

/*
* palloc_heap_check -- verifies heap state
Expand Down
2 changes: 2 additions & 0 deletions src/libpmemobj/palloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ int palloc_buckets_init(struct palloc_heap *heap);

int palloc_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
struct pmem_ops *p_ops);
#if VG_MEMCHECK_ENABLED
void *palloc_heap_end(struct palloc_heap *h);
#endif /* VG_MEMCHECK_ENABLED */
int palloc_heap_check(void *heap_start, uint64_t heap_size);
void palloc_heap_cleanup(struct palloc_heap *heap);
size_t palloc_heap(void *heap_start);
Expand Down
2 changes: 1 addition & 1 deletion utils/call_stacks_analysis/make_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def dict_extend(dict_, key, values):
def inlines(calls: Calls) -> Calls:
# common
calls['core_init'] = ['util_init', 'core_log_init', 'out_init']
calls['core_fini'] = ['out_fini']
calls['core_fini'] = ['out_fini', 'core_log_fini']
calls['common_init'] = ['core_init', 'util_mmap_init']
calls['common_fini'] = ['util_mmap_fini', 'core_fini']
calls['Last_errormsg_key_alloc'] = ['_Last_errormsg_key_alloc']
Expand Down

0 comments on commit 199e94d

Please sign in to comment.