home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.linux.misc      Linux-specific topics not covered by oth      135,536 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 135,268 of 135,536   
   The Natural Philosopher to All   
   Re: Memory Safety (Re: Python: A Little    
   07 Feb 26 12:29:00   
   
   From: tnp@invalid.invalid   
      
   On 07/02/2026 02:44, c186282 wrote:   
   > On 2/6/26 05:45, The Natural Philosopher wrote:   
   >> On 06/02/2026 01:51, c186282 wrote:   
   >>> On 2/5/26 14:27, The Natural Philosopher wrote:   
   >>>> On 05/02/2026 15:09, Pancho wrote:   
   >>>>> On 2/5/26 14:14, The Natural Philosopher wrote:   
   >>>>>   
   >>>>>> The first is of course implementation specific. C can specify a   
   >>>>>> data stack separate from a program stack and avoid code   
   >>>>>> corruption, leaving only data corruption...   
   >>>>>>   
   >>>>>   
   >>>>> Can it?  Naively, I would have thought C was normally built on top   
   >>>>> of native assembler function calls, which dictates a shared stack.   
   >>>>> Obviously you could implement a function call independent of   
   >>>>> assembler, but does anyone, in practice?   
   >>>>>   
   >>>> You simply use  a register as a second stack [data] pointer.   
   >>>>   
   >>>> Assign all your mem variables on that stack, and increment it at   
   >>>> function end.   
   >>>>   
   >>>> The assembler is trivial. Making C do it that way would not be hard,   
   >>>> either..   
   >>>   
   >>>    I actually searched on that a little, could   
   >>>    not see any civil way to specify a stack in   
   >>>    a new segment in 'C'.   
   >>>   
   >> Oh sure. You would have to modify the compiler   
   >   
   >    Ah .... no problems then .......   
   >   
   >> But IIRC the first PDP I worked on had 64k data and 64k code in   
   >> entirely different bits of RAM.   
   >   
   >    Works.   
   >   
   >    Of course actual 'segments' are kind of   
   >    passe' these days - an olde-dayz artifact   
   >    everyone hated.   
   >   
   Isn't it all handled by a memory manager?   
      
   >>>    ASM, yea, easier - you have total control (and   
   >>>    total responsibility).   
   >>>   
   >> Of course. That's what it teaches you....   
   >   
   >    Gen X/Y/Z/A2 "programmers" - have any EVER done   
   >    a thing in ASM ? Even microcontrollers are now   
   >    normally done in 'C' or MicroPython.   
   >   
   Precisely.   
      
   But at least inveterate tinkerers are leaning about things like response   
   times...   
      
   My Picos will not output anything to the USB port for quite a few   
   milliseconds after it has been initialised.   
      
   Juts be patient and use the sleep function   
      
   --   
   Religion is regarded by the common people as true, by the wise as   
   foolish, and by the rulers as useful.   
      
   (Seneca the Younger, 65 AD)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca