Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

malloc vs. _fmalloc

I'm using an old version of C for Ms-DOS and I am using

_fmalloc for a lot of my background graphic buffers.

I see far pointers all over code for accessing the video

card registers, such as RGB values are in (unsigned char far *).


I don't think that there is a speed difference between

malloc and _fmalloc... Is there?

If not, then why does most the graphics code for Ms-DOS use far

pointers and _fmalloc? Is this just some sort of

neat way to save memory?


Comments

  • : I'm using an old version of C for Ms-DOS and I am using

    : _fmalloc for a lot of my background graphic buffers.

    : I see far pointers all over code for accessing the video

    : card registers, such as RGB values are in (unsigned char far *).


    : I don't think that there is a speed difference between

    : malloc and _fmalloc... Is there?

    : If not, then why does most the graphics code for Ms-DOS use far

    : pointers and _fmalloc? Is this just some sort of

    : neat way to save memory?


    far pointers can access 640k,but near pointers can only access 65k.


Sign In or Register to comment.