MCPcopy Create free account
hub / github.com/Singular/Singular / omtTestDebug

Function omtTestDebug

omalloc/omtTest.c:36–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35#if CHECK_LEVEL > 0
36void omtTestDebug(omMemCell cell)
37{
38 size_t size = GET_SIZE(cell->spec);
39 size_t is_size;
40
41 if (om_ErrorStatus != omError_NoError) return;
42 if (cell->bin != NULL)
43 {
44 if (IS_ALIGNED(cell->spec))
45 omDebugAddrAlignedBin(cell->addr, cell->bin);
46 else
47 omDebugAddrBin(cell->addr, cell->bin);
48 }
49 else
50 {
51 if (IS_ALIGNED(cell->spec))
52 omDebugAddrAlignedSize(cell->addr, size);
53 else
54 omDebugAddrSize(cell->addr, size);
55 }
56 if (om_ErrorStatus != omError_NoError) return;
57
58 if (!OM_IS_ALIGNED(cell->addr))
59 {
60 omReportError(omError_Unknown, omError_NoError, OM_FLR,
61 "addr:%p is unaligned", cell->addr);
62 return;
63 }
64
65 if (IS_ALIGNED(cell->spec) && !OM_IS_STRICT_ALIGNED(cell->addr))
66 {
67 omReportError(omError_Unknown, omError_NoError, OM_FLR,
68 "addr:%p is not strict unaligned", cell->addr);
69 return;
70 }
71
72 is_size = omSizeOfAddr(cell->addr);
73 if (is_size < size)
74 {
75 omReportError(omError_Unknown, omError_NoError, OM_FLR,
76 "is_size==%u < size==%u", is_size, size);
77 return;
78 }
79
80 if (is_size >> LOG_SIZEOF_LONG != omSizeWOfAddr(cell->addr))
81 {
82 omReportError(omError_Unknown, omError_NoError, OM_FLR,
83 "is_sizeW==%u < sizeW==%u", is_size >> LOG_SIZEOF_LONG, omSizeWOfAddr(cell->addr));
84 return;
85 }
86
87 TestAddrContent(cell->addr, (IS_ZERO(cell->spec) ? 0 : cell->spec), is_size);
88}
89
90void TestAddrContentEqual(void* s1, void* s2, size_t size)
91{

Callers 7

omtTestErrorsFunction · 0.85
omtTestAllocFunction · 0.85
omtTestFreeFunction · 0.85
omtTestReallocFunction · 0.85
omtTestDupFunction · 0.85
omCheckCellsFunction · 0.85
mainFunction · 0.85

Calls 4

omReportErrorFunction · 0.85
omSizeOfAddrFunction · 0.85
omSizeWOfAddrFunction · 0.85
TestAddrContentFunction · 0.85

Tested by

no test coverage detected