lua-users home
lua-l archive

Re: Pooling of strings is good

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Aug 25, 2014 at 6:38 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> There are a few lessons one could learn from it. For example, if you already
> have a custom allocator in place in a security critical software, use
> memset() to zero out any new allocated memory with may have been left
> holding security relevant information.
I was doing this, now I just allocate a new buffer every time like an
idiot. I use Lua because it allows me to prototype quickly -- if the
facility is there I love avoiding work in C. Using userdata as
mutable buffers in places of immutable strings is not currently
possible/accessible. I'm arguing for an interface to this, not their
default.
> Yes, we improve as coders by generalized learning. There are a few options
> in which way to go and develop -- Yes, there is not one "true" way, since
> ages of arguing about coding, but to deny any possible generalizations
> gained from experience like you did is sure one wrong way.
I've been dealing with generalizations for 2-3 days now, in both this
thread and a few others. There is a point where generalizing is just
preventative and exclusionary, not enlightening. I find too much of
that on this list, and I'm sure you just jumped in here to offer a
tidbit of wisdom without reading the whole chain. Honestly, most of
these replies sound like "never use goto!" Someone good at their job
would recognize the time and place.

AltStyle によって変換されたページ (->オリジナル) /