diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
commit | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch) | |
tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /libcutl/cutl/shared-ptr/base.cxx | |
parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
parent | aad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff) |
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0'
with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'libcutl/cutl/shared-ptr/base.cxx')
-rw-r--r-- | libcutl/cutl/shared-ptr/base.cxx | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/libcutl/cutl/shared-ptr/base.cxx b/libcutl/cutl/shared-ptr/base.cxx deleted file mode 100644 index 1ff8469..0000000 --- a/libcutl/cutl/shared-ptr/base.cxx +++ /dev/null @@ -1,62 +0,0 @@ -// file : cutl/shared-ptr/base.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : MIT; see accompanying LICENSE file - -#include <cutl/shared-ptr/base.hxx> - -using std::size_t; - -// -// -cutl::share shared = cutl::share (1); -cutl::share exclusive = cutl::share (2); - -// -// -namespace cutl -{ - char const* not_shared:: - what () const throw () - { - return "object is not shared"; - } -} - -// -// -void* -operator new (size_t n, cutl::share s) throw (std::bad_alloc) -{ - if (s == shared) - { - // Here we need to make sure we don't break the alignment of the - // returned block. For that we need to know the maximum alignment - // of this platform. Twice the pointer size is a good guess for - // most platforms. - // - size_t* p = static_cast<size_t*> (operator new (n + 2 * sizeof (size_t))); - *p++ = 1; // Initial count. - *p++ = 0xDEADBEEF; // Signature. - return p; - } - else - return operator new (n); - -} - -void -operator delete (void* p, cutl::share s) throw () -{ - // This version of operator delete is only called when the c-tor - // fails. In this case there is no object and we can just free the - // memory. - // - if (s == shared) - { - size_t* sp = static_cast<size_t*> (p); - sp -= 2; - operator delete (sp); - } - else - operator delete (p); -} |