tkchia / newlib-ia16

Fork of IA-16 port of Newlib -- added small and medium model support
GNU General Public License v2.0
13 stars 4 forks source link

Use "malloc_size_t" type instead of "long" for size in malloc_chunk. #10

Closed bartoldeman closed 5 years ago

bartoldeman commented 5 years ago

This makes the size field 16-bit, for more efficient code than the 32-bit long. To distinguish padding, instead of negative sizes, use bit 0, which can be used as the size needs to be a multiple of the chunk alignment.

I tested this successfully with FreeCOM (which needs a 10K heap instead of 6K with OW, so there are still some changes needed)

tkchia commented 5 years ago

Hello @bartoldeman,

Thanks for the patch! I hope to look a bit more closely at it first, and maybe improve on it, before I proceed to merge it.

Thank you!