MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / Realloc

Method Realloc

source/script.cpp:2784–2795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2782}
2783
2784ResultType Script::LineBuffer::Realloc(size_t aNewSize)
2785{
2786 // The buffer typically needs to grow incrementally while joining lines in a continuation section.
2787 // Expanding in large increments avoids multiple reallocs in most files.
2788 size_t newsize = (aNewSize + EXPANSION_INTERVAL - 1) / EXPANSION_INTERVAL * EXPANSION_INTERVAL;
2789 LPTSTR newp = (LPTSTR)realloc(p, sizeof(TCHAR) * newsize);
2790 if (!newp)
2791 return FAIL;
2792 p = newp;
2793 size = newsize;
2794 return OK;
2795}
2796
2797
2798

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected