delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/15/14:45:13

From: dcasale AT my-deja DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Where is malloc info kept?
Date: Wed, 15 Nov 2000 19:35:01 GMT
Organization: Deja.com - Before you buy.
Lines: 37
Message-ID: <8uuoh4$mgp$1@nnrp1.deja.com>
References: <8uumng$kq5$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: 199.249.234.30
X-Article-Creation-Date: Wed Nov 15 19:35:01 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
X-Http-Proxy: 1.1 x72.deja.com:80 (Squid/1.1.22) for client 199.249.234.30
X-MyDeja-Info: XMYDJUIDdcasale
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <8uumng$kq5$1 AT nnrp1 DOT deja DOT com>,
  dcasale AT my-deja DOT com wrote:
> It's me again, still plugging away at trying to debug my compression
> program.  What's annoying is that I can run it on a small file set and
> it works perfectly, but on a large file set it faults on a delete.
>
> I'm wondering.  Where is the malloc info kept for each allocation?  Is
> it in the bytes immediately prior to the returned pointer?  Somewhere
> else entirely?
>
> YAMD seems to like my small, sample file set.  I get no allocation
> errors and only a few memory leaks from three fopen's and a printf
> (which I assume are supposed to be there -- 3 32 byte allocations and
> a 16384 byte allocation, respectively).  But before it finishes on my
> large file set and gets to the point where the fault on the delete
> happens, it has a failed malloc.  According to both
> _go32_dpmi_remaining_virtual_memory _and_
> _go32_dpmi_remaining_physical_memory, I've got plenty of space before
> any allocations should fail.
>
> So what gives?  Could this be a case of memory corruption on my part,
> a buggy DPMI server...what?
>
> Any ideas?

Bit of an update.  Using sbrk(0) as described in section 15.2 of the
FAQ seems to indicate that most or all of my physical memory has been
used up.  But I've still got a gigabyte of virtual memory set aside
which has barely been used at all.  ;_;

Damon Casale, damon AT WRONG DOT redshift DOT com (remove the obvious)
"...and the candidates appear to be at a virtual dead heat...or is that
a virtual heat death?" -- me


Sent via Deja.com http://www.deja.com/
Before you buy.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019