All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reggie Cushing <reggie.cushing@um.edu.mt>
To: Per Jessen <per@computer.org>
Cc: linux-c-programming@vger.kernel.org, nhorman@tuxdriver.com
Subject: Re: Function stack reallocation
Date: Wed, 28 Mar 2007 15:36:30 +0200	[thread overview]
Message-ID: <460A6F5E.6010608@um.edu.mt> (raw)
In-Reply-To: <460A5208.7070501@computer.org>

cheers for the clarification, very much appreciated.

R.

Per Jessen wrote:
> Reggie Cushing wrote:
>   
>> Hi All - I wish some insight on the possibility of reallocating a
>> function stack to a malloced regions in realtime ie I jump out of a
>> function and the next time I jump in the stack would have moved along
>> with its data. To me it seems unreliable cause the values in the stack
>> have no type hence I would not know if the stack value is a data value
>> or a pointer. If I mistakenly interpret a data value as a pointer I will
>> update the data value resulting in data corruption. I would really wish
>> some expert insight in this on this subject.

>> What you're talking about is something long these lines:
>>
>> a=malloc(chunk);
>> memcpy( chunk, SP, size);
>> SP=chunk;
>>
>>
>> The only way you "know" what's on your stack is by the variable
>> declarations you've made in your code.  The stack, wherever it is, does
>> not contain any type info.
>>
>>
>> /Per Jessen, Zurich
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>     

-- 
Reggie Cushing
Systems Engineer
310, Dept Computer Science and AI
University of Malta, MSD06, MALTA
Tel: +356 2340 2130 


  reply	other threads:[~2007-03-28 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28  7:21 Function stack reallocation Reggie Cushing
2007-03-28 11:31 ` Per Jessen
2007-03-28 13:36   ` Reggie Cushing [this message]
2007-03-28 11:36 ` Neil Horman

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=460A6F5E.6010608@um.edu.mt \
    --to=reggie.cushing@um.edu.mt \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=per@computer.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.