[Dune-devel] UGGrid system heap
Oliver Sander
oliver.sander at tu-dresden.de
Sun May 15 20:54:25 CEST 2016
Hi Markus,
when I introduced UG_USE_SYSTEM_HEAP I checked whether what you describe will be a problem,
and I decided that it would be alright the way it is.
Besides this, the old UG-internal heap will be one of the first things to completely get rid
off. It adds a bunch of extra complexity, and was measurably slower than my Linux system heap.
Cheers,
Oliver
On 14.05.2016 12:33, Markus Blatt wrote:
> Hi,
>
> I came across the following weird situation:
>
> UG uses the define UG_USE_SYSTEM_HEAP in its header ug/heaps.h which
> is included in quite a few other headers.
>
> $ cat ug/heaps
> [.. snip ... ]
> #if UG_USE_SYSTEM_HEAP
> #include <vector>
> #endif
> [... snip ...]
> typedef struct {
> enum HeapType type;
> MEM size;
> MEM used;
> MEM freelistmem;
> struct block *heapptr;
> INT topStackPtr,bottomStackPtr;
> MEM topStack[MARK_STACK_SIZE];
> MEM bottomStack[MARK_STACK_SIZE];
> INT SizeOfFreeObjects[MAXFREEOBJECTS];
> void *freeObjects[MAXFREEOBJECTS];
> #ifdef Debug
> INT objcount[MAXFREEOBJECTS];
> #endif
>
> #if UG_USE_SYSTEM_HEAP
> /* This is used only if UG_USE_SYSTEM_HEAP is set, but I don't want the
> * #ifdef in an installed header, hence the data member is there all the time. */
> std::vector<void*> markedMemory[MARK_STACK_SIZE];
> #endif
> } HEAP;
> [...]
>
> Yet, DUNE never defines UG_USE_SYSTEM_HEAP even though UG might have
> done it when it was compiled. I am a bit nervous about this. Can we
> really be sure that DUNE never directly calls a function using the
> HEAP or should be just define UG_USE_SYSTEM_HEAP and be on the safe
> side?
>
> Markus
>
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20160515/1c559502/attachment.sig>
More information about the Dune-devel
mailing list