Youthful-Passion-Fruit-teambook

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub AlexanderNekrasov/Youthful-Passion-Fruit-teambook

:warning: templates/fast_mem.cpp

Code

#define FAST_ALLOCATOR_MEMORY 10 * 1024 * 1024
#ifdef FAST_ALLOCATOR_MEMORY
int ptr = 0;
char memory[(int)FAST_ALLOCATOR_MEMORY];

inline void *operator new(size_t n) {
    char *res = memory + ptr;
    ptr += n;
    return (void *)res;
}

inline void operator delete(void *) noexcept {}
inline void operator delete(void *, size_t) {}
#endif
#line 1 "templates/fast_mem.cpp"
#define FAST_ALLOCATOR_MEMORY 10 * 1024 * 1024
#ifdef FAST_ALLOCATOR_MEMORY
int ptr = 0;
char memory[(int)FAST_ALLOCATOR_MEMORY];

inline void *operator new(size_t n) {
    char *res = memory + ptr;
    ptr += n;
    return (void *)res;
}

inline void operator delete(void *) noexcept {}
inline void operator delete(void *, size_t) {}
#endif
Back to top page