9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] go forth and ulong no more!
Date: Thu, 22 Nov 2012 09:53:16 -0500	[thread overview]
Message-ID: <ef21e89fbcb7514eb6bc29ad9416e04b@kw.quanstro.net> (raw)
In-Reply-To: <4ffeabe415eb136f18a308b2f677ce39@hamnavoe.com>

> Usize is an unsigned integer which can hold the maximum size of an
> object declared statically (the sizeof operator returns a value of
> type usize) or created by the usual allocation functions (the size
> argument of malloc is - or should be?  - type usize).  Usize may be
> smaller than uintptr, for example on amd64 where uintptr is 64 bits
> and usize is 32.  On such machines it may still be possible to
> make larger allocations (eg by writing a megamalloc function
> with a size argument in megabyte units) but not to use a usize
> variable to represent the length of the returned objects.

unfortuntely, most of this is either not true yet, or the goal is to
make it false.  the current signature of malloc is void* malloc(ulong),
the goal is to make it void* malloc(usize), additionally usize is
always ulong now, but the goal is to make it 64-bits on amd64,
and perhaps other 64-bit architectures.

therefore, i wanted to emphasis what it should be, and that the current
situtation must change.  terrible, no?  is there a better way?

(you can get a large hunk of memory with segbrk, which is cheating
and probablly dangerous.)

- erik



  parent reply	other threads:[~2012-11-22 14:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 21:49 erik quanstrom
2012-11-22  0:18 ` Federico G. Benavento
2012-11-22  1:21   ` erik quanstrom
2012-11-22  1:35     ` Bruce Ellis
2012-11-22  2:08       ` Dan Cross
2012-11-22  2:15         ` Bruce Ellis
2012-11-22  2:33           ` Charles Forsyth
2012-11-22  2:35             ` Charles Forsyth
2012-11-22  3:44               ` Bruce Ellis
2012-11-22  8:56                 ` Charles Forsyth
2012-11-22  9:02                 ` Charles Forsyth
2012-11-22 10:21                   ` erik quanstrom
2012-11-22 11:00                     ` Richard Miller
2012-11-22 11:11                       ` Charles Forsyth
2012-11-22 11:13                         ` Charles Forsyth
2012-11-22 11:32                         ` Richard Miller
2012-11-22 11:38                           ` Charles Forsyth
2012-11-22 11:49                       ` erik quanstrom
2012-11-22 13:26                         ` Richard Miller
2012-11-22 14:05                           ` Charles Forsyth
2012-11-22 14:53                           ` erik quanstrom [this message]
2012-11-22 11:50                       ` erik quanstrom
2012-11-22 11:10                   ` Richard Miller
2012-11-22 11:13                     ` Charles Forsyth
2012-11-22 11:32                     ` Charles Forsyth
2012-11-22 11:33                       ` Charles Forsyth
2012-11-22 10:31                 ` Charles Forsyth
2012-11-22 12:39                   ` Anthony Martin
2012-11-22 12:48                     ` Charles Forsyth
2012-11-22 12:50                       ` Charles Forsyth
2012-11-22 12:54                       ` Anthony Martin
2012-11-22 13:08                         ` Charles Forsyth
2012-11-22  9:59       ` Charles Forsyth
2012-11-22  9:38     ` Charles Forsyth
2012-11-22  9:40       ` Charles Forsyth
2012-11-22 18:18       ` Federico G. Benavento
2012-11-22 11:36 Richard Miller
2012-11-22 11:45 ` Charles Forsyth
2012-11-22 11:54 ` Steve Simon
2012-11-22 11:59   ` Charles Forsyth

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=ef21e89fbcb7514eb6bc29ad9416e04b@kw.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).