TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Adam Fitzpatrick
from: Frank Adam
date: 1996-07-01 16:33:00
subject: Memory Blocks snuffed ?

G'Day Adam,
 
-=> Quoting Adam Fitzpatrick to Frank Adam <=-
 
 FA> Had to rewrite it to put it through Pacific C, but the idea does not
 FA> work  there , so it seems it's the RTL doing the shuffle not the OS.   

 AF> That's understandable; if you malloc'ed a 2-byte variable (don't ask
 AF> _why_ you would...) DOS would use 32 bytes. Just a bit inefficient.
Wouldn't that be 16 bytes then ? Maybe you meant two 1 byte vars...??

 AF> FWIW, a block of memory allocated by DOS has its size stored at
 AF> (s-1):3, where s is the segment returned in AX by the mov ah,48h; int
Yes, that reflects what i've found in Borland, doesn't explain why
Pacific didn't come up with the same results though.

 AF> 21h call. So memory allocated by DOS will have the (char)(ptr-16) as
 AF> 'M' or 'Z' and (short)(ptr-13)<<4 will be the size of the memory block
 AF> (shifted 4 bits to the left because it's stored as a number of
 AF> paragraphs, ie 16-byte blocks).
What determines the size of a paragraph ? Or is it always 16 ?

  L8r Frank (fadam{at}ozemail.com.au).
  
___ Blue Wave/DOS v2.21

--- Maximus 3.01
* Origin: The Software Parlour (3:635/544)
SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 711/401 409 410 413
SEEN-BY: 711/430 808 809 932 934 712/515 713/888 714/906 800/1
@PATH: 635/544 50/99 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.