当前位置: 首页>>代码示例>>C++>>正文


C++ MemoryPool::get_for_uint64_count方法代码示例

本文整理汇总了C++中MemoryPool::get_for_uint64_count方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryPool::get_for_uint64_count方法的具体用法?C++ MemoryPool::get_for_uint64_count怎么用?C++ MemoryPool::get_for_uint64_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemoryPool的用法示例。


在下文中一共展示了MemoryPool::get_for_uint64_count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: duplicate_poly_if_needed

        ConstPointer duplicate_poly_if_needed(const std::uint64_t *poly, int coeff_count, int coeff_uint64_count, int new_coeff_count, int new_coeff_uint64_count, bool force, MemoryPool &pool)
        {
#ifdef _DEBUG
            if (poly == nullptr && coeff_count > 0 && coeff_uint64_count > 0)
            {
                throw invalid_argument("poly");
            }
            if (coeff_count < 0)
            {
                throw invalid_argument("coeff_count");
            }
            if (coeff_uint64_count < 0)
            {
                throw invalid_argument("coeff_uint64_count");
            }
            if (new_coeff_count < 0)
            {
                throw invalid_argument("new_coeff_count");
            }
            if (new_coeff_uint64_count < 0)
            {
                throw invalid_argument("new_coeff_uint64_count");
            }
#endif
            if (!force && coeff_count >= new_coeff_count && coeff_uint64_count == new_coeff_uint64_count)
            {
                return ConstPointer::Aliasing(poly);
            }
            Pointer allocation = pool.get_for_uint64_count(new_coeff_count * new_coeff_uint64_count);
            set_poly_poly(poly, coeff_count, coeff_uint64_count, new_coeff_count, new_coeff_uint64_count, allocation.get());
            ConstPointer const_allocation;
            const_allocation.acquire(allocation);
            return const_allocation;
        }
开发者ID:0wnrepo,项目名称:sealcrypto,代码行数:34,代码来源:polycore.cpp

示例2: duplicate_uint_if_needed

        ConstPointer duplicate_uint_if_needed(const std::uint64_t *uint, int uint64_count, int new_uint64_count, bool force, MemoryPool &pool)
        {
#ifdef _DEBUG
            if (uint == nullptr && uint64_count > 0)
            {
                throw invalid_argument("uint");
            }
            if (uint64_count < 0)
            {
                throw invalid_argument("uint64_count");
            }
            if (new_uint64_count < 0)
            {
                throw invalid_argument("new_uint64_count");
            }
#endif
            if (!force && uint64_count >= new_uint64_count)
            {
                return ConstPointer::Aliasing(uint);
            }
            Pointer allocation = pool.get_for_uint64_count(new_uint64_count);
            set_uint_uint(uint, uint64_count, new_uint64_count, allocation.get());
            ConstPointer const_allocation;
            const_allocation.acquire(allocation);
            return const_allocation;
        }
开发者ID:0wnrepo,项目名称:sealcrypto,代码行数:26,代码来源:uintcore.cpp

示例3: duplicate_if_needed

        Pointer duplicate_if_needed(uint64_t *original, int uint64_count, bool condition, MemoryPool &pool)
        {
#ifdef _DEBUG
            if (original == nullptr && uint64_count > 0)
            {
                throw invalid_argument("original");
            }
            if (uint64_count < 0)
            {
                throw invalid_argument("uint64_count");
            }
#endif
            if (condition == false)
            {
                return Pointer::Aliasing(original);
            }
            Pointer allocation = pool.get_for_uint64_count(uint64_count);
            memcpy(allocation.get(), original, uint64_count * bytes_per_uint64);
            return allocation;
        }
开发者ID:privategenocomputation,项目名称:privategenocomputation,代码行数:20,代码来源:mempool.cpp


注:本文中的MemoryPool::get_for_uint64_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。