MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / das_context_free

Function das_context_free

src/misc/daScriptC.cpp:1072–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070}
1071
1072void das_context_free ( das_context * context, void * ptr, uint32_t size ) {
1073 if ( !ptr ) return;
1074 if ( !size ) {
1075 // Some heap impls handle free(ptr, 0) cleanly, others assert. The C
1076 // contract requires `size` to match the allocation — fail loud rather
1077 // than silently corrupt the heap accounting.
1078 ((Context *)context)->throw_error("das_context_free: size must be non-zero when ptr is non-null");
1079 return;
1080 }
1081 ((Context *)context)->free((char *)ptr, size, nullptr);
1082}
1083
1084// --- Context heap (64-bit size) ---
1085

Callers 2

Calls 2

throw_errorMethod · 0.80
freeMethod · 0.45

Tested by

no test coverage detected