MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ptr_disposal

Function ptr_disposal

tests/test_test_impact_tree.c:2710–2725  ·  view source on GitHub ↗

Disposed owners cannot publish another read or be made READY by verify. */

Source from the content-addressed store, hash-verified

2708
2709/* Disposed owners cannot publish another read or be made READY by verify. */
2710static bool ptr_disposal(cbm_pinned_tree_t *tree) {
2711 cbm_pinned_tree_control_t control = ptr_control();
2712 pt_cancel counter = {0};
2713 control.cancelled = pt_cancelled;
2714 control.cancel_context = &counter;
2715 cbm_pinned_tree_error_t error;
2716 unsigned char byte = 0xa5;
2717 size_t copied = SIZE_MAX;
2718 cbm_pinned_tree_status_t status =
2719 cbm_pinned_tree_read_prefix(tree, 0, 6, &byte, 1, &copied, &control, &error);
2720 return ptr_status("disposal-preflight", status, CBM_PINNED_TREE_INVALID, &error) &&
2721 copied == 0 && byte == 0xa5 && counter.calls == 0 && !cbm_pinned_tree_view(tree) &&
2722 !cbm_pinned_tree_test_set_read_fault(tree, CBM_PINNED_TREE_READ_FAULT_NONE) &&
2723 cbm_pinned_tree_verify(tree, &control, &error) != CBM_PINNED_TREE_OK &&
2724 !cbm_pinned_tree_view(tree);
2725}
2726
2727/* All bad operands are valid memory; the test does not exercise alias UB. */
2728static bool ptr_preflight_case(pt_fixture *fx, unsigned kind) {

Callers 5

ptr_cancel_onceFunction · 0.85
ptr_changedFunction · 0.85
ptr_fault_caseFunction · 0.85
ptr_owner_isolationFunction · 0.85

Calls 6

ptr_controlFunction · 0.85
ptr_statusFunction · 0.85
cbm_pinned_tree_viewFunction · 0.85
cbm_pinned_tree_verifyFunction · 0.85

Tested by

no test coverage detected