All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Henning Schild <henning.schild@siemens.com>,
	Xenomai <xenomai@xenomai.org>
Subject: Re: Fw: Segmentation error 6 in rt_heap_create() without --enable-pshared
Date: Wed, 7 Nov 2018 14:31:10 +0100	[thread overview]
Message-ID: <d9daa769-4782-8d60-8150-81dfb601ca43@xenomai.org> (raw)
In-Reply-To: <20181107140007.2730e228@md1za8fc.ad001.siemens.net>

On 11/7/18 2:00 PM, Henning Schild via Xenomai wrote:
> Readding list ...
> 

Does this help?

diff --git a/lib/copperplate/heapobj-heapmem.c b/lib/copperplate/heapobj-heapmem.c
index 5c0ce9b2d..124fe564a 100644
--- a/lib/copperplate/heapobj-heapmem.c
+++ b/lib/copperplate/heapobj-heapmem.c
@@ -33,8 +33,8 @@ int __heapobj_init_private(struct heapobj *hobj, const char *name,
 	int ret;
 
 	if (mem == NULL) {
-		_mem = __STD(malloc(size));
-		if (_mem == NULL)
+		mem = __STD(malloc(size));
+		if (mem == NULL)
 			return -ENOMEM;
 	}
 	
@@ -43,16 +43,16 @@ int __heapobj_init_private(struct heapobj *hobj, const char *name,
 	else
 		snprintf(hobj->name, sizeof(hobj->name), "%p", hobj);
 
-	ret = heapmem_init(hobj->pool, _mem, size);
+	hobj->pool = mem;
+	hobj->size = size;
+
+	ret = heapmem_init(hobj->pool, mem, size);
 	if (ret) {
-		if (mem == NULL)
-			__STD(free(_mem));
+		if (_mem == NULL)
+			__STD(free(mem));
 		return ret;
 	}
 
-	hobj->pool = _mem;
-	hobj->size = size;
-
 	return 0;
 }

-- 
Philippe.


  reply	other threads:[~2018-11-07 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 13:00 Fw: Segmentation error 6 in rt_heap_create() without --enable-pshared Henning Schild
2018-11-07 13:31 ` Philippe Gerum [this message]
2018-11-07 15:09   ` Henning Schild
2018-11-08  9:17     ` Philippe Gerum
2018-11-08 15:03       ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9daa769-4782-8d60-8150-81dfb601ca43@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=henning.schild@siemens.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.