Mail Archives: djgpp/1998/05/18/14:15:27
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> replied to Colin Blackburn <cgb3 AT york DOT ac DOT uk>
>
> On Mon, 18 May 1998, Colin Blackburn wrote:
>
> > I need to malloc a chunk of memory < 64K, I also need to be sure that
> > this memory does not cross a 64K page boundary.
>
> The usual way to do this is to allocate 128K and use the part that's
> 64K-aligned.
Is more efficient to allocate the needed memory, if it crosses then reduce the
size to cover the cross-point and then allocate again, finally release the
unused memory. It could fail if the memory is too fragmented, but you can try
again (and again). Normally it never fails and you doesn't use twice the
needeed memory.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -