Ignore:
Timestamp:
Jul 2, 2017, 10:35:03 AM (23 months ago)
Author:
cameron
Message:

Deallocating dynamic buffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5543 r5544  
    156156}
    157157
    158 void StreamSetBuffer::releaseBuffer(IDISA::IDISA_Builder * const /* iBuilder */, Value * /* self */) const {
     158void StreamSetBuffer::releaseBuffer(const std::unique_ptr<kernel::KernelBuilder> & /* kb */) const {
    159159    /* do nothing: memory is stack allocated */
    160160}
     
    515515}
    516516
    517 void ExpandableBuffer::releaseBuffer(IDISA::IDISA_Builder * const iBuilder, Value * self) const {
    518     iBuilder->CreateFree(getBaseAddress(iBuilder, self));
     517void ExpandableBuffer::releaseBuffer(const std::unique_ptr<kernel::KernelBuilder> & b) const {
     518    b->CreateFree(getBaseAddress(b.get(), mStreamSetBufferPtr));
    519519}
    520520
     
    643643}
    644644
    645 void DynamicBuffer::releaseBuffer(IDISA::IDISA_Builder * const b, Value * handle) const {
     645void DynamicBuffer::releaseBuffer(const std::unique_ptr<kernel::KernelBuilder> & b) const {
    646646    /* Free the dynamically allocated buffer, but not the stack-allocated buffer struct. */
    647     b->CreateFree(b->CreateLoad(b->CreateGEP(handle, {b->getInt32(0), b->getInt32(int(DynamicBuffer::Field::BaseAddress))})));
     647    b->CreateFree(b->CreateLoad(b->CreateGEP(mStreamSetBufferPtr, {b->getInt32(0), b->getInt32(int(DynamicBuffer::Field::BaseAddress))})));
    648648}
    649649
Note: See TracChangeset for help on using the changeset viewer.