Author Topic: [SOLVED] Oxygen's Equivalents to C, Pls?  (Read 12380 times)

0 Members and 2 Guests are viewing this topic.

Charles Pegge

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #45 on: October 05, 2014, 03:55:32 PM »
Mike, do mallocs carry any length encoding, and are there any performance issues in using them as liberally as olestrings? I would be happy to switch if there were no significant disadvantages.

Charles Pegge

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #46 on: October 05, 2014, 04:05:22 PM »
Mike,

I am commited to a dual sized signed integer. One type fits nearly all, and massively simplifies API declarations. Use casting where necessary.

Mike Lobanovsky

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #47 on: October 05, 2014, 04:10:27 PM »
do mallocs carry any length encoding
None whatsoever.

Quote
are there any performance issues
None whatsoever.

Quote
using them as liberally as olestrings?
No liberty. You create them, you manage them, you free them. You are responsible for every little thing that happens to the chunks you malloced.

Quote
no significant disadvantages
None whatsoever.

One significant advantage: the addresses that msvcrt.dll mallocs are guaranteed by all the MS might to be aligned on a 4-byte boundary. Noone has ever been able to prove the contrary.

Another significant advantage: no restrictions on allocation sizes within the available memory.
« Last Edit: October 05, 2014, 05:06:14 PM by Mike Lobanovsky »

Mike Lobanovsky

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #48 on: October 05, 2014, 04:11:19 PM »
Mike,

I am commited to a dual sized signed integer. One type fits nearly all, and massively simplifies API declarations. Use casting where necessary.

Understood.

Charles Pegge

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #49 on: October 05, 2014, 04:22:33 PM »
Many thanks Mike,

Must fly now :)

Note the image URL! .../02carpet.jpg




Mike Lobanovsky

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #50 on: October 05, 2014, 05:06:43 PM »
Have a nice flight, Charles. :)

Charles Pegge

  • Guest
Re: [SOLVED] Oxygen's Equivalents to C, Pls?
« Reply #51 on: October 05, 2014, 11:21:16 PM »
Mike,

Would you recommend s HeapAlloc based system?