Sujet : Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"
De : eesnimi (at) *nospam* osa.pri.ee (Paavo Helde)
Groupes : comp.lang.c++ comp.lang.cDate : 08. Mar 2024, 13:41:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <usf11f$1mk5l$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Mozilla Thunderbird
07.03.2024 17:36 David Brown kirjutas:
CPython does use garbage collection, as far as I know.
AFAIK CPython uses reference counting, i.e. basically the same as C++ std::shared_ptr (except that it does not need to be thread-safe).
With reference counting one only knows how many pointers there are to a given heap block, but not where they are, so heap compaction would not be straightforward.
Python also has zillions of extensions written in C or C++ (all of AI related work for example), so having e.g. heap compaction of Python objects only might not be worth of it.