emacs-devel
[Top][All Lists]
Advanced

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

Re: Lisp object that refers to a C struct


From: Stephen J. Turnbull
Subject: Re: Lisp object that refers to a C struct
Date: Wed, 17 Oct 2012 15:21:40 +0900

Eli Zaretskii writes:

 > > What happens if someone passes you this same integer some time after
 > > you've freed the C struct?

More interesting, what happens if somebody chooses "I feel lucky" and
passes you a random integer that happens to be a "live" watch?

ISTM it fails safe (ie, doesn't crash).  But it's not good.  So really
you want this to be entirely internal somehow.  The only way to do
that is to have an opaque type that you can only get a pointer to from
the watch constructor.

All-I-need-to-know-about-ABCs-I-learned-in-kindergarten-ly y'rs,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]