edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] Object identifiers
Date: Mon, 24 Jul 2017 07:25:29 +0200	[thread overview]
Message-ID: <20170724052529.GB31626@nautica> (raw)
In-Reply-To: <20170623205238.eklhad@comcast.net>

Hi,

Karl Dahlke wrote on Sun, Jul 23, 2017:
> I really don't have a better alternative right now. What do you think?

I'm not quite sure it will help, if the problem is a desynchronisation
between what we think is still linked and what duktape thinks is still
linked then even with an indirect mapping we still will have pointers to
invalid memory, unless you plan on using duktape to handle the map
itself.


I've had a look at duktape documentation and code, and I have an idea
that might be less code.
The duk_create_heap function lets us provide alloc, realloc and free
functions - we use it with duk_create_heap_default which is
duk_create_heap with a lot of NULL parameters but we can override some
of the base functions.

If we overload malloc, realloc and free with just a little wrapper that
tells the main edbrowse process "this address changed" (for realloc) or
"this address is no longer valid" (for free), nothing to do for malloc,
then we will have a safe way to determin a pointer can no longer be
used.

This is not as implementation-generic as making our own ID, but it
sounds like a _lot_ less work and should be safe for us.
I also think most implementations will have a way to use our own
allocation functions too so it might be more reuseable than it looks.


What do you think?

-- 
Dominique

  parent reply	other threads:[~2017-07-24  5:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24  0:52 Karl Dahlke
2017-07-24  1:04 ` Chris Brannon
2017-07-24  5:25 ` Dominique Martinet [this message]
2017-07-24  6:43   ` Karl Dahlke
2017-07-24  7:49     ` Dominique Martinet
2017-07-24  7:03   ` Karl Dahlke
2017-07-24  5:43 ` Robert Ransom
2017-07-24 17:45   ` Adam Thompson

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=20170724052529.GB31626@nautica \
    --to=asmadeus@codewreck.org \
    --cc=edbrowse-dev@lists.the-brannons.com \
    /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).