Board index » delphi » stack overflow

stack overflow

Hello people, glad to see the pascal lang is alive and kicking and that im
not the only happy pascal coder out there

Im having a stack overflow problem with a program i've been writing:
{$M $8000,0,80000}

prgram output is as follows
total stack : 32766
used         : 25688
unused     : 7078

as you can see, the stack is large and needed, i've put everything i can
onto the heap (i use a heap manager to minimise heap when useing 'EXEC')
i cant make the stack much smaller as it overflows, the program is a
command shell that needs to be able to pass commands through to DOS when
required. the program itself is 42k at the mo and slowly getting larger
every day (im constantly updating it to suit my needs.. today i added a
expression calculator to it :-)   )  anyway, i need to find some way to SWAP
OUT to disk or xms so that the program leaves only a 'trace' in memory or
something for when the exec ends.
any help or source would be really appreciated as this is eating a large
chunk of dos mem (leaves about 530k base - that aint much)

adam.m...@ntlworld.com

any replys to above address.
Thanks
Adam mead.

 

Re:stack overflow


In article <2DAP5.6835$f12.116...@news2-win.server.ntlworld.com>,
  "nat.mead" <nat.m...@ntlworld.com> wrote:
Quote
> Hello people, glad to see the pascal lang is alive and kicking and
> that im not the only happy pascal coder out there

> Im having a stack overflow problem with a program i've been writing:
> {$M $8000,0,80000}

> prgram output is as follows
> total stack : 32766
> used         : 25688
> unused     : 7078

> as you can see, the stack is large and needed, i've put everything i
> can onto the heap (i use a heap manager to minimise heap when
> useing 'EXEC') i cant make the stack much smaller as it overflows,
> the program is a command shell that needs to be able to pass commands
> through to DOS when required. the program itself is 42k at the mo and
> slowly getting larger every day (im constantly updating it to suit my
> needs.. today i added a expression calculator to it :-)   )  anyway,
> i need to find some way to SWAP OUT to disk or xms so that the
> program leaves only a 'trace' in memory or
> something for when the exec ends.
> any help or source would be really appreciated as this is eating a
> large  chunk of dos mem (leaves about 530k base - that aint much)

Ralph Brown's SPWNO413.ZIP.

Robert
--
Robert AH Prins
pr...@bigfoot.com

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

Re:stack overflow


Quote
"nat.mead" <nat.m...@ntlworld.com> wrote:
>Hello people, glad to see the pascal lang is alive and kicking and that im
>not the only happy pascal coder out there

>Im having a stack overflow problem with a program i've been writing:
>{$M $8000,0,80000}

>prgram output is as follows
>total stack : 32766
>used         : 25688
>unused     : 7078

>as you can see, the stack is large and needed, i've put everything i can
>onto the heap (i use a heap manager to minimise heap when useing 'EXEC')
>i cant make the stack much smaller as it overflows, the program is a
>command shell that needs to be able to pass commands through to DOS when
>required. the program itself is 42k at the mo and slowly getting larger
>every day (im constantly updating it to suit my needs.. today i added a
>expression calculator to it :-)   )  anyway, i need to find some way to SWAP
>OUT to disk or xms so that the program leaves only a 'trace' in memory or
>something for when the exec ends.
>any help or source would be really appreciated as this is eating a large
>chunk of dos mem (leaves about 530k base - that aint much)

Also look at Turbopower's OPEXEC unit. This is a very good unit for
shelling out to other programs. It swaps everything except for about a
10kB stub and swaps to either disk/xms/ems.

Good luck.

Mike McWhinney
Chief Engineer
elja, Inc.

Other Threads