Skip to content

Commit 49ace8b

Browse files
committed
Improve red-black tree map implementation
* Single allocation per node (54% memory reduction) * Eliminate double traversal in insert (3-4x faster) * Comprehensive error handling and overflow protection * Improve test suite - Red-black tree property validation - Memory stress testing (100K elements) - Edge case coverage
1 parent ccdcc30 commit 49ace8b

File tree

4 files changed

+892
-203
lines changed

4 files changed

+892
-203
lines changed

src/breakpoint.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
static inline int cmp(const void *arg0, const void *arg1)
1313
{
1414
riscv_word_t *a = (riscv_word_t *) arg0, *b = (riscv_word_t *) arg1;
15-
return (*a < *b) ? _CMP_LESS : (*a > *b) ? _CMP_GREATER : _CMP_EQUAL;
15+
return (*a < *b) ? MAP_CMP_LESS
16+
: (*a > *b) ? MAP_CMP_GREATER
17+
: MAP_CMP_EQUAL;
1618
}
1719

1820
breakpoint_map_t breakpoint_map_new()

0 commit comments

Comments
 (0)