diff --git a/NativeAdrenoMemory.cpp b/NativeAdrenoMemory.cpp index 37c417a..e6145c0 100644 --- a/NativeAdrenoMemory.cpp +++ b/NativeAdrenoMemory.cpp @@ -280,7 +280,9 @@ IOReturn NativeAdrenoMemory::allocateSystem(size_t bytes,unsigned bits,size_t bu bool cleaned=false; if(prepared && prepared->held() && prepared->bytes==bytes && prepared->write_combined==write_combined) { descriptor_=prepared->descriptor;grant_=prepared->grant;cleaned=prepared->cleaned;*prepared=NativeAdrenoSystemPages{}; - } else if(NativeAdrenoPoolAllocate(bytes,UINT64_C(1)<live_)connection->core_->offerSystemPages(pages.held()?&pages:nullptr); + /* Offered for every BoAlloc, held or not: allocateSystem then knows it runs under the lock and leaves the pool alone. */ + if(connection->live_)connection->core_->offerSystemPages(alloc?&pages:nullptr); if(connection->live_ && freeing)connection->core_->collectFreedPages(&freed); status=connection->live_?connection->core_->dispatch(method,input,input_size,output,output_size,&g.clock):kIOReturnNotReady; if(connection->live_)connection->core_->offerSystemPages(nullptr);