[Insight-users] puzzle about the compiler heap limit of msvc

Chen Fu novalet@yahoo.com.cn
Thu, 3 Apr 2003 10:56:39 +0800 (CST)


Hi!
There is a good news!!
I finally bypass this problem by insert #include
"itkimage.h" into stdafx.h.
It seems precompile engine cut the requirement of
expanding template every time.

 --- Ron Inbar <ron@mediguide.co.il> 的正文:> Hi,
> 
> I also ran into these problems when compiling VTK.
> If you try to compile it several times in a row, the
> compiler succeeds in
> compiling more files each time.  So maybe you should
> try this easy solution
> before anything else, even though it is a bit
> annoying and time-consuming.
> 
> Ron
> 
> 
> > -----Original Message-----
> > From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
> > Sent: Wednesday, April 02, 2003 4:42 PM
> > To: Chen Fu
> > Cc: Insight-users@public.kitware.com
> > Subject: Re: [Insight-users] puzzle about the
> compiler heap limit of msvc
> > 
> > 
> > Hi Chen,
> > 
> > Most Insight applications are happy with
> > a heap size = /Zm1000 in VisualStudio 7.0
> > 
> > The problem in your code looks more like
> > some recursive inclusion of files.
> > 
> > Your wrapping looks nice though...
> > 
> > Possible suspects are the global typedefs,
> > and a misspelling of the #ifdef guards in
> > some class.
> > 
> > 
> > For example:
> > 
> >    In flowBlock.h  you are doing "typedef"s
> >    outside the class FlowBlock.
> > 
> >    When you include this files in others,
> >    this typedefs will be global, which
> >    may be undesirable.
> > 
> >    We use to put the typedefs inside the
> >    classes and then access them using the
> >    scope resolution, like
> > 
> > 
> >    class FlowBlock {
> >    {
> >     public:
> >       typedef  unsigned char  PixelType;
> >       typedef  itk::Image< PixelType,  2 >  
> ImageType;
> >     public:
> >       void SetInput(ImageType* input);
> >       ImageType* GetOutput();
> >    };
> > 
> > 
> >    Then in the derived class
> > 
> > 
> >    class Source: public FlowBlock
> >    {
> >    public:
> >         typedef FlowBlock::ImageType  ImageType;
> >  	typedef itk::ImageFileReader< ImageType  >
> >                                        
> ReaderType;
> > 
> >  	ReaderType::Pointer reader;
> > 
> >       //...etc
> >    };
> > 
> > 
> > ---
> > 
> > This encapsulates the types and facilitates
> > to use wrapping classes with different ImageTypes
> > 
> > 
> > Hope that helps,
> > 
> > 
> >    Luis
> > 
> > 
> > 
> > ----------------
> > Chen Fu wrote:
> > > Hi!
> > > I use msvc7 to compile my little application of
> itk.
> > > I package itk class into a flowblock.
> > >
> > >
> ====================================================
> > > #ifndef FLOWBLOCK_H
> > > #define FLOWBLOCK_H
> > >
> > > #include "itkImage.h"
> > >
> > > typedef   unsigned char  PixelType;
> > > typedef itk::Image< PixelType,  2 >   ImageType;
> > >
> > > class FlowBlock
> > > {
> > > public:
> > > 	void SetInput(ImageType* input);
> > > 	ImageType* GetOutput();
> > > };
> > >
> > > #endif
> > >
> ====================================================
> > >
> > > and wrap some itk class in this block, for
> example
> > >
> ====================================================
> > > #ifndef SOURCE_H
> > > #define SOURCE_H
> > >
> > > #include "itkImageFileReader.h"
> > >
> > > class Source: public FlowBlock
> > > {
> > > public:
> > > 	typedef itk::ImageFileReader< ImageType  >
> > > ReaderType;
> > >
> > > 	ReaderType::Pointer reader;
> > >
> > > 	Source()
> > > 	{
> > > 		reader = ReaderType::New();
> > > 	}
> > >
> > > 	void SetInput(ImageType* input)
> > > 	{
> > > 	}
> > >
> > > 	ImageType * GetOutput()
> > > 	{
> > > 		return reader->GetOutput();
> > > 	}
> > > };
> > >
> > > #endif
> > >
>
=====================================================
> > >
> > > besides the source, there are also sink(writer)
> and
> > > various filter.
> > >
> > > But if i include several such header file(.h),
> the
> > > msvc7 report c1076 error:
> > > compiler limit : internal heap limit reached
> (msvc)
> > >
> > > I turn the /zm to 1000 or 2000, but still has
> this
> > > error.
> > > I don't know what to do now. Any one can lend me
> a hand?
> > >
> > > =====
> > > Remote Scensing Satellite Ground Station
> > > Chinese Academy of Science
> > >
> > >
>
_________________________________________________________
> > > Do You Yahoo!?
> > > 雅虎通网络KTV, 随时随地免费卡拉OK~~
> > >
> >
>
http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index
> > .html
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users@public.kitware.com
> > >
>
http://public.kitware.com/mailman/listinfo/insight-users
> > >
> > 
> > 
> > 
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users@public.kitware.com
> >
>
http://public.kitware.com/mailman/listinfo/insight-users
> This e-mail message has been sent by MediGuide
> and is for the use of the intended recipients only.
> 
=== message truncated === 

=====
Remote Scensing Satellite Ground Station
Chinese Academy of Science

_________________________________________________________
Do You Yahoo!? 
雅虎通网络KTV, 随时随地免费卡拉OK~~
http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html