Skip to content
HeapAllocatorDeinit

HeapAllocatorDeinit

Description

Release every page chunk currently owned by self. After this call the heap is back to its post-HeapAllocatorInit state and any pointer previously returned by AllocatorAlloc through this heap is invalid.

Parameters

Name Direction Description
self in,out Heap allocator instance.

Success

Function returns. Owned pages have been unmapped.

Failure

No action when self is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
        }
    
        HeapAllocatorDeinit(&heap);
        return ok;
    }
            AllocatorFree(alloc, p, 64);
        }
        HeapAllocatorDeinit(&heap);
        return ok;
    }
            AllocatorFree(alloc, b, 32);
        }
        HeapAllocatorDeinit(&heap);
        return ok;
    }
        }
    
        HeapAllocatorDeinit(&heap);
        return ok;
    }
        }
    
        HeapAllocatorDeinit(&heap);
        return ok;
    }
        }
    
        HeapAllocatorDeinit(&heap);
        return ok;
    }
            AllocatorFree(alloc, p, 256);
        }
        HeapAllocatorDeinit(&heap);
        return ok;
    }
        AllocatorFree(alloc1, a, 32);
        AllocatorFree(alloc2, b, 32);
        HeapAllocatorDeinit(&h1);
        HeapAllocatorDeinit(&h2);
        return ok;
        AllocatorFree(alloc2, b, 32);
        HeapAllocatorDeinit(&h1);
        HeapAllocatorDeinit(&h2);
        return ok;
    }
        VecDeinit(&test_vec);
    
        HeapAllocatorDeinit(&aligned4);
        HeapAllocatorDeinit(&aligned16);
        return result;
    
        HeapAllocatorDeinit(&aligned4);
        HeapAllocatorDeinit(&aligned16);
        return result;
    }
        VecDeinit(&vec);
    
        HeapAllocatorDeinit(&aligned8);
        return result;
    }
        VecDeinit(&vec_h);
    
        HeapAllocatorDeinit(&h_default);
        HeapAllocatorDeinit(&h8);
        HeapAllocatorDeinit(&h16);
    
        HeapAllocatorDeinit(&h_default);
        HeapAllocatorDeinit(&h8);
        HeapAllocatorDeinit(&h16);
        HeapAllocatorDeinit(&h32);
        HeapAllocatorDeinit(&h_default);
        HeapAllocatorDeinit(&h8);
        HeapAllocatorDeinit(&h16);
        HeapAllocatorDeinit(&h32);
        HeapAllocatorDeinit(&h64);
        HeapAllocatorDeinit(&h8);
        HeapAllocatorDeinit(&h16);
        HeapAllocatorDeinit(&h32);
        HeapAllocatorDeinit(&h64);
        return result;
        HeapAllocatorDeinit(&h16);
        HeapAllocatorDeinit(&h32);
        HeapAllocatorDeinit(&h64);
        return result;
    }
        VecDeinit(&aligned_vec);
    
        HeapAllocatorDeinit(&aligned8);
        DefaultAllocatorDeinit(&alloc);
        return result;
        VecDeinit(&aligned_vec);
    
        HeapAllocatorDeinit(&aligned8);
        DefaultAllocatorDeinit(&alloc);
        return result;
        GraphDeinit(&graph_h);
    
        HeapAllocatorDeinit(&aligned_64);
        HeapAllocatorDeinit(&aligned_32);
        HeapAllocatorDeinit(&aligned_16);
    
        HeapAllocatorDeinit(&aligned_64);
        HeapAllocatorDeinit(&aligned_32);
        HeapAllocatorDeinit(&aligned_16);
        HeapAllocatorDeinit(&aligned_8);
        HeapAllocatorDeinit(&aligned_64);
        HeapAllocatorDeinit(&aligned_32);
        HeapAllocatorDeinit(&aligned_16);
        HeapAllocatorDeinit(&aligned_8);
        DefaultAllocatorDeinit(&alloc);
        HeapAllocatorDeinit(&aligned_32);
        HeapAllocatorDeinit(&aligned_16);
        HeapAllocatorDeinit(&aligned_8);
        DefaultAllocatorDeinit(&alloc);
        return result;
    
        GraphDeinit(&graph);
        HeapAllocatorDeinit(&alloc);
        return result;
    }
        VecDeinit(&src);
        VecDeinit(&dst);
        HeapAllocatorDeinit(&local_heap);
        return result;
    }
    }
    
    void HeapAllocatorDeinit(HeapAllocator *self) {
        if (!self) {
            return;
            LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, m_.data);                                                 \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
            SysAbort();                                                                                                    \
        } while (0)
            LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, m_.data);                                                 \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
        } while (0)
            LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, m_.data);                                                  \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
        } while (0)
            LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, m_.data);                                                 \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
            SysAbort();                                                                                                    \
        } while (0)
            LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, m_.data);                                                 \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
        } while (0)
            LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, m_.data);                                                  \
            StrDeinit(&m_);                                                                                                \
            HeapAllocatorDeinit(&log_alloc_);                                                                              \
        } while (0)
    
    #define DefaultAllocatorInit()      HeapAllocatorInit()
    #define DefaultAllocatorDeinit(ptr) HeapAllocatorDeinit(ptr)
    
    #endif // MISRA_STD_ALLOCATOR_DEFAULT_H
Last updated on