in reply to Re: Re: Is $^M a leftover April Fool?
in thread Is $^M a leftover April Fool?

I wasn't suggesting that it isn't there. As perrin points out, it's right there in malloc.c at the top of the grep listing I included.

My problem is

  1. The almost complete absence of documentation.
  2. It's useablilty (or lack thereof).

A little more documentation outlining under what circumstances it can be used--which perl build options are required for it to be enabled etc.--plus some indication of how one might use it would go a long way.

Perhaps because Win32-perl generally translates to AS perl which doesn't appear to be built with the PERL_EMERGENCY_SBRK option enabled, and the facility hasn't been exercised under Win32.

Maybe because sbrk(2) is a *nix system thing and Win32 doesn't have any equivalent?

Try as I might, I can't persuade $^M to do anything, at least not that I can detect.

It is quite difficult to tell as when you have swapping enabled, you can allocate an aweful lot of memory before you run out, but by the time you do, the system has become quite unresponsive, so actually detecting the point of failure is very hard. I tried setting a %SIG{__DIE__} handler that use Carp::croak() to give me a trace back, but I never saw it.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

Replies are listed 'Best First'.
Re: Re: Re: Re: Is $^M a leftover April Fool?
by perrin (Chancellor) on Aug 30, 2003 at 05:02 UTC
    It looks to me like you are simply not the target audience. The target audience is madmen who are so desperate to figure out where their programs are running out of memory that they are willing to look at malloc.c. This is clearly a last resort thing that no sane person would ever require, given the many other ways to debug a program.

    Anyway, the docs do say that your Perl has to be built with -DPERL_EMERGENCY_SBRK and with Perl's malloc selected, so if you're AS build was not done that way, you can't expect it to work for you.

      Agreed,it's never going to work on AS distribution, which is why I've been trying this out on my own build of perl.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
      If I understand your problem, I can solve it! Of course, the same can be said for you.