#13731: Fix libsingular memory management
--------------------------------------------------------------+-------------
Reporter: nbruin | Owner:
rlm
Type: defect | Status:
new
Priority: major | Milestone:
sage-5.6
Component: memleak | Resolution:
Keywords: | Work issues:
Report Upstream: Fixed upstream, in a later stable release. | Reviewers:
Authors: Nils Bruin, Simon King | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------------------+-------------
Comment (by nbruin):
OK, my C skills are insufficient for this:
{{{
#include<stdio.h>
typedef struct{
int a; int b; int c; int d; int e;
} composite;
typedef composite *pointer;
void main() {
pointer v;
printf("sizeof(composite)=%d\n",sizeof(composite));
printf("sizeof(t)=%d\n",sizeof(t));
printf("sizeof(*v)=%d\n",sizeof(*v));
};
}}}
produces the desired output:
{{{
sizeof(composite)=20
sizeof(pointer)=8
sizeof(*v)=20
}}}
So if I have my hands on an instance of a "pointer" variable, I can get
the size of the structure pointed to by dereferencing. However, if I want
to get this straight from the pointer type there doesn't seem to be a
syntax for it. `sizeof(*pointer)` gives an error ... How do you get that
information?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13731#comment:95>
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.