[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: request reversion regarding scm_i_* removal
From: |
Andy Wingo |
Subject: |
Re: request reversion regarding scm_i_* removal |
Date: |
Mon, 18 Aug 2008 11:36:59 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Good day!
Still on holiday, but the train provides a lovely hacktime.
On Mon 11 Aug 2008 01:10, address@hidden (Ludovic Courtès) writes:
> Andy Wingo <address@hidden> writes:
>
>> The removal of the scm_i_* functions is an ABI break in the stable 1.8
>> series. It should be reverted. (It's a great fix for master though.)
>
> The "i" always stood for "internal", but let's see what can be done...
> ;-)
Yeah, I know. Bad me. (And others, of course.) But I don't think "We
told you so" is a good reason to change within a stable series -- and
in this particular case I don't think its cost is worth its benefits.
I do think it's a super fix for master, though! :)
> I don't mind leaving `scm_i_symbol_length ()' public for the sake of ABI
> compatibility, just like `scm_i_string_chars ()' and a few others.
>
> Eventually, application code should have a configure check, allowing it
> to use either `_i_' or `_c_'.
Yeah, I agree.
>> but more seriously the port table, with the
>> scm_i_port_table_mutex. (The port API sucks, I know.)
>
> What do you mean? What code outside `libguile' uses
> `scm_i_port_table_mutex'?
Guile-gnome does, when registering a new port type, for gnome-vfs. The
port API isn't threadsafe, and also sucks as I mentioned ;) From
gnome-vfs/gnome/gw/gnome-vfs-port.c:
#define LOCK scm_i_pthread_mutex_lock (&scm_i_port_table_mutex)
#define UNLOCK scm_i_pthread_mutex_unlock (&scm_i_port_table_mutex)
SCM
scm_gnome_vfs_handle_to_port (GnomeVFSHandle *handle, GnomeVFSOpenMode mode,
const gchar* uri)
#define FUNC_NAME "scm_gnome_vfs_handle_to_port"
{
long mode_bits = vfs_mode_bits (mode);
SCM port;
scm_t_port *pt;
LOCK;
port = scm_new_port_table_entry (scm_tc16_vport);
SCM_SET_CELL_TYPE(port, scm_tc16_vport | mode_bits);
pt = SCM_PTAB_ENTRY(port);
pt->rw_random = mode & GNOME_VFS_OPEN_RANDOM;
SCM_SETSTREAM (port, handle);
if (mode_bits & SCM_BUF0)
scm_vport_buffer_add (port, 0, 0);
else
scm_vport_buffer_add (port, -1, -1);
SCM_SET_FILENAME (port, scm_makfrom0str (uri));
UNLOCK;
return port;
}
#undef FUNC_NAME
Also there's the bit in the flush() vfunc about scm_i_terminating.
Nastiness all around.
Regards,
Andy
--
http://wingolog.org/