#9482: implicit_plot3d gives "Out of memory allocating triangulation" when
plotting an empty surface
-----------------------------------+----------------------------------------
Reporter: cwitty | Owner: cwitty
Type: defect | Status: positive_review
Priority: major | Milestone: sage-4.5.2
Component: graphics | Keywords:
Author: Carl Witty | Upstream: N/A
Reviewer: Karl-Dieter Crisman | Merged:
Work_issues: |
-----------------------------------+----------------------------------------
Changes (by kcrisman):
* status: needs_review => positive_review
* reviewer: => Karl-Dieter Crisman
Comment:
Replying to [comment:5 cwitty]:
> According to "man malloc":
>
> If size is 0, then malloc()
> returns either NULL, or a unique pointer value that can later be
> successfully passed to free().
>
> I guess under Linux malloc(0) returns NULL and under OSX it returns "a
unique pointer value that can later be successfully passed to free()".
Interestingly, the Mac malloc man page is different.
{{{
The malloc() function allocates size bytes of memory and returns a pointer
to the allocated memory.
<snip>
If successful, calloc(), malloc(), realloc(), reallocf(), and valloc()
functions return a pointer to
allocated memory. If there is an error, they return a NULL pointer
and set errno to ENOMEM.
}}}
Anyway, a good [http://c-faq.com/ansi/malloc0.html FAQ] points out
"Portable code must either take care not to call malloc(0), or be prepared
for the possibility of a null return." So I think your changes make
sense.
Incidentally, I am having trouble finding the following:
1. Definition of `point_c` - it isn't in `point_c.pxi` nor in the ext
directory, as far as I can tell.
2. Online references to this angle bracket asterisk notation {{{<point_c
*>}}} and friends. None of the search engines take these characters into
account, and neither of my C tutorials have this notation. I think I get
what it does, but it would be nice to know for sure.
Final result: this is an improvement over the previous situation, but for
positive review and inclusion, one should open a ticket for the Jmol
problem you indicate. I can't figure out exactly what you mean by that,
though I do get
{{{
sage: G.jmol_repr(G.default_render_params())
<snip>
AttributeError: 'RenderParams' object has no attribute 'output_archive'
}}}
if that's what you are referring to. I get that other places, too, though
I have no examples currently.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9482#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.