Remove thread protection on memory
@@ -367,20 +367,16 @@ mem_realloc(void* ptr, size_t size) {
size_t oldSize;
if (ptr == NULL) { /* If pointer is not valid */
- ESP_CORE_PROTECT();
newPtr = mem_alloc(size); /* Only allocate memory */
- ESP_CORE_UNPROTECT();
return newPtr;
}
- ESP_CORE_PROTECT();
oldSize = mem_getusersize(ptr); /* Get size of old pointer */
newPtr = mem_alloc(size); /* Try to allocate new memory block */
if (newPtr != NULL) { /* Check success */
memcpy(newPtr, ptr, size > oldSize ? oldSize : size); /* Copy old data to new array */
mem_free(ptr); /* Free old pointer */
}
- ESP_CORE_UNPROTECT();
return newPtr;
}
