[Bf-committers] Re: MEM_CacheLimiter breaks msvc6 compile unrepairable

Peter Schlaile peter at schlaile.de
Thu Feb 9 11:30:33 CET 2006

Hi Ole,

> ok tried commenting out that rebind stuff,
> but as expected instation of
> typedef std::list<MEM_CacheLimiterHandleCClass*,
> 		  MEM_Allocator<MEM_CacheLimiterHandleCClass* > > list_t;
> a few lines later :
> 	list_t cclass_list;
> bails out with the meaningfull error message: (me loves msvc6 STL
> support for that)
> MEM_CacheLimiterC-Api.cpp
> C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\list(130) : error
> C2143: syntax error : missing ';' before '<end Parse>'
>          C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\list(129) :
> while compiling class-template member function '__thiscall
> std::list<class MEM_CacheLimiterHandleCClass *,struct
> MEM_Allocator<class MEM_CacheLimiterHandleCClass *> >::std::list<c
> lass MEM_CacheLimiterHandleCClass *,struct MEM_Allocator<class
> MEM_CacheLimiterHandleCClass *> >(const struct MEM_Allocator<class
> MEM_CacheLimiterHandleCClass *> &)'
> Error executing cl.exe.
> in <list>
> ...
> 	explicit list(const _A& _Al = _A())
> here-->		: allocator(_Al),
> 		_Head(_Buynode()), _Size(0) {}
> ...
> but like i said expected since
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/HTML/MEMORY_allocator.asp
> states:
> ".. This means you cannot write an allocator that uses any pointer or
> reference types that differ from those used by allocator, ..."
> and i think that's exactly what
> typedef std::list<MEM_CacheLimiterHandleCClass*,
> 		  MEM_Allocator<MEM_CacheLimiterHandleCClass* > > list_t;
> is supposed to do.

I don't think so. Rebind is used, if I understand it correctly, to move an
allocator from one type to another.

I simply wanted to use type T (in this case "MEM_CacheLimiterHandleCClass*") like this:

typedef std::list<T, MEM_Allocator<T> > list_t;

This should definitely work with MSVC-6, since if this does not work the
compiler is unable to use custom allocators at all!

Has anyone a link to examples of custom allocator usage with VC6?

At least

typedef std::list<int, MEM_Allocator<int> > list_t;

should work, right?

> P.S. Peter, we're proud of you using a real C++ compiler ... btw on
> windows i have cygwin with gcc and the free vc7 compiler running too. I
> can boot to linux and complile there. So to me it's a esoteric self
> punishment to keep blender compiling on msvc6. ( hope you smell the
> sarcams in there )

Since the latest VC++-Compiler is downloadable from the MS-Homepage for
free, I'm also not sure if there is any point in supporting ancient compilers...

(Any volunteers to make it compile with Watcom C/C++ V10.0,
*Grinning, ducking and running*)


More information about the Bf-committers mailing list