News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

I need crtdll.inc or replacement

Started by Ran, March 13, 2007, 09:43:33 PM

Previous topic - Next topic

Vortex

I cannot guarantee you that all the C run-time functions are the best for every occasion. Hutch's masm32.lib has a lot of optimized functions. You can use MichaelW's code timing macros to evaluate the procedures.

http://www.masm32.com/board/index.php?topic=770.0

Ran

He, thanks Vortex.
I'm gonna look into this.

I'm asking You all this questions because I found:

http://www.microsoft.com/msj/archive/S572.aspx

quote:

As an example, if you use sprintf in your code, try using wsprintf instead. It can prevent several KB worth of RTL code from being added to your program. Likewise, functions like strcpy can be replaced with lstrcpy. Using malloc and free in your code can add several KB of additional code and data. Consider replacing those functions with the HeapXXX equivalents (HeapAlloc, HeapFree, and so on). (For more on this subject, see my "Under the Hood" column in this issue.)

his book: http://cs.mipt.ru/index.php?id=94

Ran

Ehtyar

At the risk of being labeled a "purist" again, i do not include the crt in projects if i can avoid it for this very reason. In addition, i also do not like the function naming scheme, and the fact that it is simply a wrapper for functions most likely already available to your program through the system libraries.

Ehtyar.

MichaelW

Quoteand the fact that it is simply a wrapper for functions most likely already available to your program through the system libraries.

AFAIK there are no system equivalents for the character classification, data conversion, floating-point support, or searching/sorting functions, or all but a few of the string manipulation functions, and most of the remaining functions are, by design, much easier (and safer) to use than the system equivalents.
eschew obfuscation

hutch--

#19
The MSVCRT library was made available because of demand, no-one is forced to use it but many with a C background find it familiar and convenient and get very reliable results with it. Notions of "purism" are a defacto attempt to restrict what other people choose to use on the basis of fashion. I have heard nonsense in the past that you should not use OLE, various memory allocation schemes within the OS and the like but they are all there for a reason and this offer the programmer a far wider range of choice.

In this world you choose what you use and you are not bound by the dictates of fashion in what you use.

PS : I have moved the trailing postings to the Workshop under the topic "Ehtyar on using MSVCRT" as the Campus has specific rules on assisting new members and learners.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MichaelW

Ran,

Considering that MSVCRT.DLL and CRTDLL.DLL are DLLs, and not a static libraries, I think it's worth pointing out another relevant statement from the same section of the MSJ article.

QuoteIf you choose to statically link these routines (as opposed to using the DLL version), you pay a price in executable size.

eschew obfuscation

Ran