🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
1 messages
1 total messages Started by Applied Magnetics Mon, 26 Nov 1990 17:03
malloc() an indian giver?
#1286
Author: Applied Magnetics
Date: Mon, 26 Nov 1990 17:03
20 lines
1233 bytes
This thread originated in comp.unix.aix and turned out to be a BSD/SysV
issue.

I always thought that if malloc() returned a non-NULL pointer, you
could safely go ahead and use it.  If for any reason the memory request
can't be granted, malloc() returns NULL.

It appears that on SysV unixes, the sbrk() system call expands the
address space of the calling process __without checking that enough
swap space exists to back it up__.  Consequently, malloc() will happily
allocate virtual memory beyond the capacity of the machine; if the
process tries to use it all, the machine runs out of swap space and
some (innocent) process must die.  This is supposedly a feature to
allow sparse use of a large address space.

My questions are:
  1) Is this for real?
  2) If I ask for memory, I mean it.  What do I do, O net?

--Pierre Asselin, R&D, Applied Magnetics Corp.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads