oidmap: make entry cleanup explicit in oidmap_clear#2169
oidmap: make entry cleanup explicit in oidmap_clear#2169Seyi007 wants to merge 5 commits intogit:masterfrom
Conversation
|
There are issues in commit 4b47fa7:
|
4b47fa7 to
1f5e841
Compare
|
There is an issue in commit 1f5e841:
|
1f5e841 to
462048a
Compare
|
There is an issue in commit 462048a:
|
462048a to
422aaa6
Compare
subratakundu2312-web
left a comment
There was a problem hiding this comment.
TANNY NANDY @ 270GMAIL .COM
|
ADD OFF FIND OR CHECK NO : 7500143 |
422aaa6 to
89809ea
Compare
|
There is an issue in commit 010b49c:
|
89809ea to
9f889ff
Compare
|
Invalid author email in a0ab068: "[email protected]" |
9f889ff to
ea883be
Compare
|
Invalid author email in a0ab068: "[email protected]" |
ea883be to
4fc6e71
Compare
|
Invalid author email in a0ab068: "[email protected]" |
4fc6e71 to
fba6a40
Compare
|
There is an issue in commit 05e8cb9:
|
fba6a40 to
3de04be
Compare
|
Invalid author email in 14f46e1: "[email protected]" |
Replace oidmap's use of hashmap_clear_() and layout-dependent freeing with an explicit iteration and optional free callback. This removes reliance on struct layout assumptions while keeping the existing API intact. Add tests for oidmap_clear_with_free behavior. test_oidmap__clear_with_free_callback verifies that entries are freed when a callback is provided, while test_oidmap__clear_without_free_callback verifies that entries are not freed when no callback is given. These tests ensure the new clear implementation behaves correctly and preserves ownership semantics. Signed-off-by: Seyi Kuforiji <[email protected]>
oidmap_clear_with_free() As part of the conversion away from oidmap_clear(), switch the missing_objects map to use oidmap_clear_with_free(). missing_objects stores struct missing_objects_map_entry instances, which own an xstrdup()'d path string in addition to the container struct itself. Previously, rev-list manually freed entry->path before calling oidmap_clear(&missing_objects, true). Introduce a dedicated free callback and pass it to oidmap_clear_with_free(), consolidating entry teardown into a single place and making cleanup semantics explicit. This improves clarity and maintainability. Signed-off-by: Seyi Kuforiji <[email protected]>
Replace the use of oidmap_clear(&seen_at_depth, 1) in filter_trees_free() with oidmap_clear_with_free(). The seen_at_depth map stores heap-allocated struct seen_map_entry objects. Previously, passing 1 relied on oidmap_clear() internally calling free() on each entry. Convert this to the explicit oidmap_clear_with_free() API and provide a typed free_seen_map_entry() helper to free each container entry. This makes the ownership and cleanup policy explicit and removes reliance on the legacy boolean free_entries parameter. Signed-off-by: Seyi Kuforiji <[email protected]>
Replace the direct oidmap_clear() call in odb_free() with oidmap_clear_with_free(), and introduce a free_replace_map_entry() helper to properly free each struct replace_object stored in the map. This centralizes cleanup logic and ensures entries are released correctly via a dedicated callback. Signed-off-by: Seyi Kuforiji <[email protected]>
Switch cleanup of the string_entry oidmap to oidmap_clear_with_free() and introduce a free_string_entry() helper to properly free each allocated struct string_entry. This aligns with the ongoing migration to use the callback-based oidmap cleanup API. Signed-off-by: Seyi Kuforiji <[email protected]>
3de04be to
16f2979
Compare
No description provided.