Re: malloc() implementation



Clever Monkey <clvrmnky.invalid@xxxxxxxxxxxxxxxxxxx> writes:
Flash Gordon wrote:
John Devereux wrote:
Flash Gordon <spam@xxxxxxxxxxxxxxxxxx> writes:

You can't write a malloc routine in standard C which might be part of
why it is in the standard library, hence the suggestion of asking in a
Linux group.

What you *can* do though is statically allocate a memory buffer, then
allocate out of that with your own "malloc".
True, as long as you call is something other than malloc ;-)
It all depends on what the OP actually wants to achieve.

Wouldn't interpositioning allow you to define a default global symbol
"malloc" that would essentially overwrite the Standard one?

If the implementation happens to support it, but such support is not
required by the standard.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • compile error on alpha - binutils problem?
    ... {standard input}:246: Error: macro requires $at register while noat in effect ... # PCCARD support ...
    (Linux-Kernel)
  • Re: New Ethiopian Find - Oldest Biped At 3.8-4 mya
    ... >> This is not an example of a double standard. ... > criticise arguments you don't support for not ... *elimination of human hair as it relates to swimming. ... primarily--neither set out to address hair reduction) required a rather ...
    (sci.anthropology.paleo)
  • Re: So, they started synthesizing shared variables?
    ... The standard gives users something to ask your vendor to implement. ... in this case is not VHDL compliant. ... WRT support and not support, the 2004 approach is identical to the ... coding styles that would be accepted by a compliant synthesis tool. ...
    (comp.lang.vhdl)
  • Re: porting from C++Builder
    ... and I do believe that standard support of PME ... the java was growing and, obviously, microsoft initially tried to ...
    (microsoft.public.dotnet.languages.vc)
  • Re: calling convention stdcalll and cdecl call
    ... printf is defined in terms of fprintf. ... I don't have C89 standard handy at the moment, ... so a conforming C compiler has to support it. ... would be an improvement over cdecl. ...
    (microsoft.public.vc.language)