MCPcopy Create free account
hub / github.com/MyGUI/mygui / strcpy_insitu_allow

Function strcpy_insitu_allow

UnitTests/TestApp/pugixml.cpp:1702–1715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1700#endif
1701
1702inline bool strcpy_insitu_allow(size_t length, uintptr_t allocated, char_t* target)
1703{
1704 assert(target);
1705 size_t target_length = strlength(target);
1706
1707 // always reuse document buffer memory if possible
1708 if (!allocated)
1709 return target_length >= length;
1710
1711 // reuse heap memory if waste is not too great
1712 const size_t reuse_threshold = 32;
1713
1714 return target_length >= length && (target_length < reuse_threshold || target_length - length < target_length / 2);
1715}
1716
1717PUGI__FN bool strcpy_insitu(char_t*& dest, uintptr_t& header, uintptr_t header_mask, const char_t* source)
1718{

Callers 1

strcpy_insituFunction · 0.70

Calls 1

strlengthFunction · 0.70

Tested by

no test coverage detected