Olivier Galibert wrote:
On Tue, Apr 18, 2000 at 09:53:36PM -0400, Olivier Galibert wrote:
> here's what i have so far, and i'd like comments:
Found the time, after all, even if I should be doing something else.
On the whole, I like it. Some remarks, though:
- static inline functions are infinitely preferable to macros
you can't do alloca in an inline fun.
- alloca() doesn't go well with string concatenation (no realloca)
only if you always allocate exactly what you need. cf my Dynarr code.
- alloca() bites you if you try to return one of these strings to a
caller or change a string which was given to you through a function
call
did you miss this?
----- Moving to the heap -----
eito_malloc (eistr):
eifree (eistr):
eito_alloca (eistr):
- we'll need a kind of sprintf
probably true ... but you could always pull out the raw data and use doprnt().
- dynamically allocated strings tend to add a whole lot of overhead in
all mutating operations to check whether they need to be extended.
this doesn't make sense to me. one if statement?
But what I'm the most afraid of is that it is going to add yet another
copy of data in a number of cases, which will slow down the system.
In particular I dread the Lisp_String->eistring->cstring->system call
path which may be seen as an easy way to code this.
true ... but better to be correct than fast. most of the time, this will not
be used for huge chunks of data, and it really won't matter. if you really care
about efficiency, there are other (but less convenient) ways, e.g. use
TO_EXTERNAL_FORMAT directly.
But like I said, on the whole, I like it.
thanks!
OG.
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/typing.html.