MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / allocate_shadow

Function allocate_shadow

src/jrd/sdw.cpp:1129–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1127
1128
1129static Shadow* allocate_shadow(jrd_file* shadow_file,
1130 USHORT shadow_number, USHORT file_flags)
1131{
1132/**************************************
1133 *
1134 * a l l o c a t e _ s h a d o w
1135 *
1136 **************************************
1137 *
1138 * Functional description
1139 * Allocate a shadow block, setting all
1140 * the fields properly.
1141 *
1142 **************************************/
1143 Database* dbb = GET_DBB();
1144
1145 Shadow* shadow = FB_NEW_POOL(*dbb->dbb_permanent) Shadow();
1146 shadow->sdw_file = shadow_file;
1147 shadow->sdw_number = shadow_number;
1148 if (file_flags & FILE_manual)
1149 shadow->sdw_flags |= SDW_manual;
1150 if (file_flags & FILE_conditional)
1151 shadow->sdw_flags |= SDW_conditional;
1152
1153 // Link the new shadow into the list of shadows according to
1154 // shadow number position. This is so we will activate
1155 // conditional shadows in the order specified by shadow number.
1156 // Note that the shadow number may not be unique in this list
1157 // - as could happen when shadow X is dropped, and then X is
1158 // recreated.
1159
1160 Shadow** pShadow;
1161 for (pShadow = &dbb->dbb_shadow; *pShadow; pShadow = &((*pShadow)->sdw_next))
1162 {
1163 if ((*pShadow)->sdw_number >=shadow_number)
1164 break;
1165 }
1166
1167 shadow->sdw_next = *pShadow;
1168 *pShadow = shadow;
1169
1170 return shadow;
1171}
1172
1173
1174static int blocking_ast_shadowing(void* ast_object)

Callers 2

SDW_addFunction · 0.85
SDW_startFunction · 0.85

Calls 2

GET_DBBFunction · 0.85
ShadowClass · 0.70

Tested by

no test coverage detected