[zeromq-dev] czmq and zalloc - handling OOM situations

AJ Lewis aj.lewis at quantum.com
Thu Sep 29 16:24:02 CEST 2011

Ok, this is a sanity check of my work.  I've attached the beginnings of
adding error checking around the zmalloc call - this is not tested and
should not be pushed into the tree!  I'm just wanting to make sure I'm
heading in the right direction and that this looks like something that
will be accepted.

I'm trying to break each changeset out by the class it affects.  This
reaches out into any classes that use the main class of course, but
those changes *should* be minimal in most cases.

Anyway - patches are attached.  Again - these should not be applied,
just given a quick once over to make sure I'm not missing the boat.


On Tue, Sep 27, 2011 at 02:02:30PM -0500, Pieter Hintjens wrote:
> On Tue, Sep 27, 2011 at 10:14 AM, Steven McCoy <steven.mccoy at miru.hk> wrote:
> > Wasn't there a discussion on /. recently about this, Dijkstra's view
> > tends to be taken out of context because it was in regard to Pascal
> > which has an alternative method of breaking out of multiple loops.
> > I count 160 instances of goto in OpenPGM, all for error cases.
> Totally agreed. In OpenAMQ I count several hundred gotos, all in error
> cases. It's a valid pattern IME, if it makes error handling simpler.

AJ Lewis
Software Engineer
Quantum Corporation

Work:    651 688-4346

The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-new-define-option-that-behaves-the-same-as-_ZM.patch
Type: text/x-diff
Size: 1328 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110929/381260bb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Deal-with-zmalloc-failing-to-allocate-memory-in-the-.patch
Type: text/x-diff
Size: 4372 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110929/381260bb/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Deal-with-zmalloc-failing-to-allocate-memory-in-the-.patch
Type: text/x-diff
Size: 20887 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110929/381260bb/attachment-0002.patch>

More information about the zeromq-dev mailing list