~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/kernel/src/erlang.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
423
423
    list_to_binary(List).
424
424
 
425
425
%%
426
 
%% memory/[0,1]
 
426
%% erlang:memory/0 may fail with a notsup exception
427
427
%%
428
428
 
429
429
memory() ->
430
 
    erlang:system_info(memory).
 
430
    case erlang:system_info(memory) of
 
431
        Result when is_list(Result) -> Result;
 
432
        Error -> erlang:error(Error, [])
 
433
    end.
 
434
 
 
435
%%
 
436
%% erlang:memory/1 may fail with a badarg or a notsup exception
 
437
%%
431
438
 
432
439
memory(Type) when is_atom(Type) ->
433
440
    case erlang:system_info({memory, [Type]}) of