Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Frank Beythien Newsgroups: openwatcom.users.c_cpp Subject: Re: Using function "_bheapseg" under OS/2 (use of high memory) Date: Mon, 14 Dec 2015 09:51:36 +0100 Lines: 50 Message-ID: References: <11p86vVJT4Oe-pn2-d8Y0M1Bb9KwY@slat60-1> Reply-To: fbeythien@gmx.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net 1qL9khfYiBKRx6R5ljU+nAFt24kWnb1rm1WD35ZtXwndZylxw= Cancel-Lock: sha1:JpDiqUyIsZlBxboDVlD7k4/SfYU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <11p86vVJT4Oe-pn2-d8Y0M1Bb9KwY@slat60-1> Xref: csiph.com openwatcom.users.c_cpp:3460 Am 14.12.2015 um 16:07 schrieb Steven Levine: > On Mon, 14 Dec 2015 07:03:03 UTC, Lars Erdmann > wrote: > > Hi Lars, > >> how do you convert (under OS/2 and using high memory if possible) a >> based address (which _bmalloc returns) into a full 32-bit linear address ? > > You don't. _bmalloc is supported only by wcc. Check the docs or the > malloc.h #ifdefs. > >> If all of this does not work under 32-bit OS/2, does anyone know any >> other functions in the Watcom RTL that would allow me to manage a heap >> in high memory ? > > I implemented high memory support so that we could link the Mozilla > apps. > > See malloc.h for: > > #if defined(__OS2__) && defined(__386__) > _WCRTLINK int _use_os2_high_mem( int fUseHighMem ); /* Returns prior > setting */ > _WCRTLINK void *_os2lmalloc( size_t amount ); > _WCRTLINK void *_os2hmalloc( size_t amount ); > #endif > > It's on my list to update the runtime library docs. That said, usage > is pretty straightforward. _use_os2_high_mem sets the global > allocation strategy used by malloc and friends. The default is low > memory only for backwards compatibility. _os2lmalloc and _os2hmalloc > override the global strategy for the current call. > > This all works similar to the gcc libc implementation. However, there > are no os2safe wrappers yet. > > Of course you will need an OpenWatcom built from the current depot > sources to use these functions. You can try http://efbe.musca.uberspace.de for an OS/2 build from current perforce data. > > Have fun, > > Steven CU/2 Frank