🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3077

sbrk/brk

#3077
From: Peter da Silva
Date: Mon, 26 Mar 1990 15:16
32 lines
1593 bytes
> I just looked again.  Okay, no problem.  sbrk can point to malloc(),
> perhaps, or a routine that will call malloc() or free() appropriately.

Nooooo. sbrk() should point to allocmem, and malloc should call sbrk.
that way you can replace sbrk and have malloc know about it.

> But brk() will have to be dummy-implemented.

Don't implement it at all. It's not universally abailable even on UNIX.

> Peter> No, that's bcopy and memmov. memcpy doesn't check argument order.

> How so?  Presumably there is a source and destination...

Yes, but it doesn't check for overlapping moves whether the sources is before
the destination or not. It can be inlined by a simple loop.

Someone else will have to point you at Global. I just know the name.

Peter> I would recommend providing a traditional division, just for
Peter> the sake of programmer sanity.

> Logically, sure.  Technically, well...  they'll likely be mixed in the
> actual Exec libraries.

I hope not. What if I want to run something that doesn't use stdio? (yes,
such programs exist, generally in other languages than C)
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
      v  "Have you hugged your wolf today?" `-_-'
Technical Details
Message-ID: <5457@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!rutgers!texbell!sugar!peter

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!rutgers!texbell!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: sbrk/brk
Message-ID: <5457@sugar.hackercorp.com>
Date: 26 Mar 90 15:16:23 GMT
Organization: Sugar Land Unix - Houston
Lines: 32