Re: Compiler Bug HP ANSI C++ creates memory Leak

From: Brand Hunt (brandhunt_at_hotmail.com)
Date: 05/29/04


Date: 28 May 2004 23:47:38 -0700

Helmut-

It isn't necessarily a memory leak. There is no guarantee that an
allocator will return the same memory block that has been most
recently
freed (even if the new malloc call is for the same size of the block
just freed.)

Yes, many allocators choose to implement it the way you expect.

That said, you could _easily_ be seeing a problem with memory
fragmentation within the allocator. NewCode has a whitepaper on their
website that describes this problem within the HP-UX allocator. I
recommend you give the whitepaper a look and write them for an eval:

http://www.newcodeinc.com

-Brand

Helmut Zeisel <helmut.zeisel@aon.at> wrote in message
news:<c8v4j5.3oo.1@webpc1.vaig.vads.cc>...
> We are porting a C++ program to HPUX. Because of a compiler bug, our
> program creates memory leaks. Essentially the problem is as follows:
>
<snip>
>
> Is there a newer version of aCC available that corrects this bug?
>
> Helmut Zeisel



Relevant Pages

  • Re: Compiler Bug HP ANSI C++ creates memory Leak
    ... It isn't necessarily a memory leak. ... allocator will return the same memory block that has been most ... fragmentation within the allocator. ... NewCode has a whitepaper on their ...
    (comp.sys.hp.hpux)
  • [rfc][patch 2/3] mm: bootmem2 - memory block oriented boot time allocator
    ... A boot time allocator that uses a bitmap for all pages in the system, ... +static inline int bootmem_node_block ... * A memory block oriented boot-time allocator. ...
    (Linux-Kernel)
  • Re: "new byte[132]" alignment on 16 bytes
    ... > instructions on this buffer without having to copy the memory block. ... > The SSE instructon set assumes that the starting physical memory block is ... another memory allocator to solve this too. ... it's a task for the CLR's heap manager which is the ...
    (microsoft.public.dotnet.languages.csharp)
  • [PATCH 5/7] dmapool: Tidy up includes and add comments
    ... We were missing a copyright statement and license, so add GPLv2, David ... * This allocator returns small blocks of a given size which are DMA-able by ... + * If such a memory block can't be allocated, ...
    (Linux-Kernel)
  • memory leak detection in evc
    ... Is there a way to detect memory leak in evc environment? ... as a test,i allocate a memory block and don't free it purposely, the compiler doesn't give any warning. ...
    (microsoft.public.pocketpc.developer)