MCPcopy Create free account
hub / github.com/catboost/catboost / ReadMagic

Function ReadMagic

catboost/libs/helpers/serialization.cpp:38–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 void ReadMagic(const char* expectedMagic, ui32 magicSize, ui32 alignment, IInputStream* stream) {
39 TCountingInput input(stream);
40 TArrayHolder<char> loadedMagic = TArrayHolder<char>(new char[magicSize]);
41 ui32 loadedBytes = input.Load(loadedMagic.Get(), magicSize);
42 CB_ENSURE(
43 loadedBytes == magicSize && Equal(loadedMagic.Get(), loadedMagic.Get() + magicSize, expectedMagic),
44 "Failed to deserialize: couldn't read magic"
45 );
46 SkipPadding(&input, alignment);
47 }
48
49}
50

Callers 5

LoadMethod · 0.85
LoadMethod · 0.85
LoadNonOwningMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85

Calls 4

EqualFunction · 0.70
SkipPaddingFunction · 0.70
LoadMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected