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

Method Align

util/stream/aligned.h:32–42  ·  view source on GitHub ↗

* Ensures alignment of the position in the input stream by skipping * some input. * * @param alignment Alignment. Must be a power of 2. */

Source from the content-addressed store, hash-verified

30 * @param alignment Alignment. Must be a power of 2.
31 */
32 void Align(size_t alignment = sizeof(void*)) {
33 Y_ASSERT(IsPowerOf2(alignment));
34
35 if (Position_ & (alignment - 1)) {
36 size_t len = alignment - (Position_ & (alignment - 1));
37
38 do {
39 len -= DoSkip(len);
40 } while (len);
41 }
42 }
43
44private:
45 size_t DoRead(void* ptr, size_t len) override;

Callers 2

BuildDictionaryMetaInfoFunction · 0.45
Y_UNIT_TESTFunction · 0.45

Calls 1

IsPowerOf2Function · 0.50

Tested by

no test coverage detected