Path: csiph.com!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.programming Subject: Re: heaps as relates to memory and stacks Date: Sat, 25 Jul 2020 10:47:55 +0200 Organization: Aioe.org NNTP Server Lines: 26 Message-ID: References: <6502c023-8376-4be4-8d39-84011a9c0dado@googlegroups.com> NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: csiph.com comp.programming:11096 On 25/07/2020 10:05, G G wrote: > are the heaps that are discussed in heaps and stacks > memory, relating to processes, a program running in memory, > implemented as a heap data structure, like a tree, > > https://en.wikipedia.org/wiki/Heap_(data_structure)#Applications Do you mean heap as memory pool (to dynamically allocate objects)? Like: https://en.wikipedia.org/wiki/Memory_management#Dynamic_memory_allocation Then no, I don't see how a priority queue would be useful here. There is a huge number of memory management algorithms due to various factors influencing the choice, like predictability, real-time constraints, concurrent access, fragmentation prevention etc. Also when a specific allocation/deallocation order is known, e.g. most notorious are stack (LIFO) and arena, when object sizes are known in advance etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de