From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: one more about memory alloc - free memory of needed amount only Date: 24 Aug 2000 11:37:29 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 12 Message-ID: <8o31dp$c0t$1@antares.lu.erisoft.se> References: <39A4EB1B DOT 29871 DOT 12C6F4 AT localhost> <8o2m1l$6tb$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) wrote: : unsigned char * realptr = malloc(300+63); : some_type * ptr_to_use = (some_type *) : (realptr + (((unsigned long) realptr) % 64)); I think you mean "(realptr + (64 - (((unsigned long) realptr) % 64)))". Try mind-running it with realptr = 1, e. g. Right, MartinS