Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libpmemobj/palloc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2015-2022, Intel Corporation */
/* Copyright 2015-2023, Intel Corporation */

/*
* palloc.c -- implementation of pmalloc POSIX-like API
Expand Down Expand Up @@ -269,13 +269,13 @@ palloc_heap_action_exec(struct palloc_heap *heap,
/* suppress unused-parameter errors */
SUPPRESS_UNUSED(heap);

#ifdef DEBUG
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add not only logging but also reading. The thought is that this can affect performance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause one extra PMem memory access on all heap operations. It might be worth checking if the performance impact isn't negligible.

enum memblock_state s = act->m.m_ops->get_state(&act->m);
if (s == act->new_state || s == MEMBLOCK_STATE_UNKNOWN) {
ERR("invalid operation or heap corruption");
#ifdef DEBUG
ASSERT(0);
}
#endif /* DEBUG */
}

/*
* The actual required metadata modifications are chunk-type
Expand Down