115 | 507 | } _Z5AllocI6Tuple2IP6BigStriEJS2_iEEPT_DpOT0_ Line | Count | Source | 78 | 5 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 5 | "Expected no padding"); | 91 | | | 92 | 5 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 5 | #if MARK_SWEEP | 96 | 5 | int obj_id; | 97 | 5 | int pool_id; | 98 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 5 | #if MARK_SWEEP | 104 | 5 | header->obj_id = obj_id; | 105 | 5 | #ifndef NO_POOL_ALLOC | 106 | 5 | header->pool_id = pool_id; | 107 | 5 | #endif | 108 | 5 | #endif | 109 | 5 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 5 | memset(obj, 0, sizeof(T)); | 114 | 5 | return new (obj) T(std::forward<Args>(args)...); | 115 | 5 | } |
_Z5AllocI4DictIP5PointP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI5PointJiiEEPT_DpOT0_ Line | Count | Source | 78 | 34 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 34 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 34 | "Expected no padding"); | 91 | | | 92 | 34 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 34 | #if MARK_SWEEP | 96 | 34 | int obj_id; | 97 | 34 | int pool_id; | 98 | 34 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 34 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 34 | #if MARK_SWEEP | 104 | 34 | header->obj_id = obj_id; | 105 | 34 | #ifndef NO_POOL_ALLOC | 106 | 34 | header->pool_id = pool_id; | 107 | 34 | #endif | 108 | 34 | #endif | 109 | 34 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 34 | memset(obj, 0, sizeof(T)); | 114 | 34 | return new (obj) T(std::forward<Args>(args)...); | 115 | 34 | } |
_Z5AllocI4DictIiP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 78 | 5 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 5 | "Expected no padding"); | 91 | | | 92 | 5 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 5 | #if MARK_SWEEP | 96 | 5 | int obj_id; | 97 | 5 | int pool_id; | 98 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 5 | #if MARK_SWEEP | 104 | 5 | header->obj_id = obj_id; | 105 | 5 | #ifndef NO_POOL_ALLOC | 106 | 5 | header->pool_id = pool_id; | 107 | 5 | #endif | 108 | 5 | #endif | 109 | 5 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 5 | memset(obj, 0, sizeof(T)); | 114 | 5 | return new (obj) T(std::forward<Args>(args)...); | 115 | 5 | } |
_Z5AllocI4ListIiEJEEPT_DpOT0_ Line | Count | Source | 78 | 334 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 334 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 334 | "Expected no padding"); | 91 | | | 92 | 334 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 334 | #if MARK_SWEEP | 96 | 334 | int obj_id; | 97 | 334 | int pool_id; | 98 | 334 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 334 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 334 | #if MARK_SWEEP | 104 | 334 | header->obj_id = obj_id; | 105 | 334 | #ifndef NO_POOL_ALLOC | 106 | 334 | header->pool_id = pool_id; | 107 | 334 | #endif | 108 | 334 | #endif | 109 | 334 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 334 | memset(obj, 0, sizeof(T)); | 114 | 334 | return new (obj) T(std::forward<Args>(args)...); | 115 | 334 | } |
_Z5AllocI10IndexErrorJEEPT_DpOT0_ Line | Count | Source | 78 | 5 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 5 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 5 | "Expected no padding"); | 91 | | | 92 | 5 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 5 | #if MARK_SWEEP | 96 | 5 | int obj_id; | 97 | 5 | int pool_id; | 98 | 5 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 5 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 5 | #if MARK_SWEEP | 104 | 5 | header->obj_id = obj_id; | 105 | 5 | #ifndef NO_POOL_ALLOC | 106 | 5 | header->pool_id = pool_id; | 107 | 5 | #endif | 108 | 5 | #endif | 109 | 5 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 5 | memset(obj, 0, sizeof(T)); | 114 | 5 | return new (obj) T(std::forward<Args>(args)...); | 115 | 5 | } |
_Z5AllocI4DictIlP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 78 | 2 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 2 | "Expected no padding"); | 91 | | | 92 | 2 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 2 | #if MARK_SWEEP | 96 | 2 | int obj_id; | 97 | 2 | int pool_id; | 98 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 2 | #if MARK_SWEEP | 104 | 2 | header->obj_id = obj_id; | 105 | 2 | #ifndef NO_POOL_ALLOC | 106 | 2 | header->pool_id = pool_id; | 107 | 2 | #endif | 108 | 2 | #endif | 109 | 2 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 2 | memset(obj, 0, sizeof(T)); | 114 | 2 | return new (obj) T(std::forward<Args>(args)...); | 115 | 2 | } |
_Z5AllocI4ListIlEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI10ValueErrorJEEPT_DpOT0_ Line | Count | Source | 78 | 7 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 7 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 7 | "Expected no padding"); | 91 | | | 92 | 7 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 7 | #if MARK_SWEEP | 96 | 7 | int obj_id; | 97 | 7 | int pool_id; | 98 | 7 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 7 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 7 | #if MARK_SWEEP | 104 | 7 | header->obj_id = obj_id; | 105 | 7 | #ifndef NO_POOL_ALLOC | 106 | 7 | header->pool_id = pool_id; | 107 | 7 | #endif | 108 | 7 | #endif | 109 | 7 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 7 | memset(obj, 0, sizeof(T)); | 114 | 7 | return new (obj) T(std::forward<Args>(args)...); | 115 | 7 | } |
_Z5AllocI10ValueErrorJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI7OSErrorJiEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI12RuntimeErrorJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI12UnicodeErrorJP6BigStrEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI7IOErrorJiEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocIN5iolib10SignalSafeEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
Unexecuted instantiation: _Z5AllocI7OSErrorJRiEEPT_DpOT0_ _Z5AllocIN5mylib5CFileEJRP8_IO_FILEEEPT_DpOT0_ Line | Count | Source | 78 | 7 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 7 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 7 | "Expected no padding"); | 91 | | | 92 | 7 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 7 | #if MARK_SWEEP | 96 | 7 | int obj_id; | 97 | 7 | int pool_id; | 98 | 7 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 7 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 7 | #if MARK_SWEEP | 104 | 7 | header->obj_id = obj_id; | 105 | 7 | #ifndef NO_POOL_ALLOC | 106 | 7 | header->pool_id = pool_id; | 107 | 7 | #endif | 108 | 7 | #endif | 109 | 7 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 7 | memset(obj, 0, sizeof(T)); | 114 | 7 | return new (obj) T(std::forward<Args>(args)...); | 115 | 7 | } |
Unexecuted instantiation: _Z5AllocI7IOErrorJRiEEPT_DpOT0_ Unexecuted instantiation: _Z5AllocI17KeyboardInterruptJEEPT_DpOT0_ _Z5AllocI4ListIP6BigStrEJEEPT_DpOT0_ Line | Count | Source | 78 | 48 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 48 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 48 | "Expected no padding"); | 91 | | | 92 | 48 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 48 | #if MARK_SWEEP | 96 | 48 | int obj_id; | 97 | 48 | int pool_id; | 98 | 48 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 48 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 48 | #if MARK_SWEEP | 104 | 48 | header->obj_id = obj_id; | 105 | 48 | #ifndef NO_POOL_ALLOC | 106 | 48 | header->pool_id = pool_id; | 107 | 48 | #endif | 108 | 48 | #endif | 109 | 48 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 48 | memset(obj, 0, sizeof(T)); | 114 | 48 | return new (obj) T(std::forward<Args>(args)...); | 115 | 48 | } |
_Z5AllocI4DictIiP6BigStrEJSt16initializer_listIiES4_IS2_EEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
Unexecuted instantiation: _Z5AllocI8KeyErrorJEEPT_DpOT0_ _Z5AllocI4DictIP6BigStriEJSt16initializer_listIS2_ES4_IiEEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4DictIP6BigStriEJEEPT_DpOT0_ Line | Count | Source | 78 | 8 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 8 | "Expected no padding"); | 91 | | | 92 | 8 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 8 | #if MARK_SWEEP | 96 | 8 | int obj_id; | 97 | 8 | int pool_id; | 98 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 8 | #if MARK_SWEEP | 104 | 8 | header->obj_id = obj_id; | 105 | 8 | #ifndef NO_POOL_ALLOC | 106 | 8 | header->pool_id = pool_id; | 107 | 8 | #endif | 108 | 8 | #endif | 109 | 8 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 8 | memset(obj, 0, sizeof(T)); | 114 | 8 | return new (obj) T(std::forward<Args>(args)...); | 115 | 8 | } |
_Z5AllocI4DictIP6BigStrS2_EJEEPT_DpOT0_ Line | Count | Source | 78 | 3 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 3 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 3 | "Expected no padding"); | 91 | | | 92 | 3 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 3 | #if MARK_SWEEP | 96 | 3 | int obj_id; | 97 | 3 | int pool_id; | 98 | 3 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 3 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 3 | #if MARK_SWEEP | 104 | 3 | header->obj_id = obj_id; | 105 | 3 | #ifndef NO_POOL_ALLOC | 106 | 3 | header->pool_id = pool_id; | 107 | 3 | #endif | 108 | 3 | #endif | 109 | 3 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 3 | memset(obj, 0, sizeof(T)); | 114 | 3 | return new (obj) T(std::forward<Args>(args)...); | 115 | 3 | } |
_Z5AllocI4DictIiiEJEEPT_DpOT0_ Line | Count | Source | 78 | 8 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 8 | "Expected no padding"); | 91 | | | 92 | 8 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 8 | #if MARK_SWEEP | 96 | 8 | int obj_id; | 97 | 8 | int pool_id; | 98 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 8 | #if MARK_SWEEP | 104 | 8 | header->obj_id = obj_id; | 105 | 8 | #ifndef NO_POOL_ALLOC | 106 | 8 | header->pool_id = pool_id; | 107 | 8 | #endif | 108 | 8 | #endif | 109 | 8 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 8 | memset(obj, 0, sizeof(T)); | 114 | 8 | return new (obj) T(std::forward<Args>(args)...); | 115 | 8 | } |
_Z5AllocI4ListIP6Tuple2IiiEEJEEPT_DpOT0_ Line | Count | Source | 78 | 2 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 2 | "Expected no padding"); | 91 | | | 92 | 2 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 2 | #if MARK_SWEEP | 96 | 2 | int obj_id; | 97 | 2 | int pool_id; | 98 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 2 | #if MARK_SWEEP | 104 | 2 | header->obj_id = obj_id; | 105 | 2 | #ifndef NO_POOL_ALLOC | 106 | 2 | header->pool_id = pool_id; | 107 | 2 | #endif | 108 | 2 | #endif | 109 | 2 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 2 | memset(obj, 0, sizeof(T)); | 114 | 2 | return new (obj) T(std::forward<Args>(args)...); | 115 | 2 | } |
_Z5AllocI6Tuple2IiiEJiiEEPT_DpOT0_ Line | Count | Source | 78 | 8 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 8 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 8 | "Expected no padding"); | 91 | | | 92 | 8 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 8 | #if MARK_SWEEP | 96 | 8 | int obj_id; | 97 | 8 | int pool_id; | 98 | 8 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 8 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 8 | #if MARK_SWEEP | 104 | 8 | header->obj_id = obj_id; | 105 | 8 | #ifndef NO_POOL_ALLOC | 106 | 8 | header->pool_id = pool_id; | 107 | 8 | #endif | 108 | 8 | #endif | 109 | 8 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 8 | memset(obj, 0, sizeof(T)); | 114 | 8 | return new (obj) T(std::forward<Args>(args)...); | 115 | 8 | } |
_Z5AllocI4DictIP6Tuple2IiiEiEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4DictIP6Tuple2IP6BigStriEiEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4LineJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI10DerivedObjJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4ListIbEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4ListIPiEJEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocIN5mylib9BufWriterEJEEPT_DpOT0_ Line | Count | Source | 78 | 4 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 4 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 4 | "Expected no padding"); | 91 | | | 92 | 4 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 4 | #if MARK_SWEEP | 96 | 4 | int obj_id; | 97 | 4 | int pool_id; | 98 | 4 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 4 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 4 | #if MARK_SWEEP | 104 | 4 | header->obj_id = obj_id; | 105 | 4 | #ifndef NO_POOL_ALLOC | 106 | 4 | header->pool_id = pool_id; | 107 | 4 | #endif | 108 | 4 | #endif | 109 | 4 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 4 | memset(obj, 0, sizeof(T)); | 114 | 4 | return new (obj) T(std::forward<Args>(args)...); | 115 | 4 | } |
_Z5AllocIN5mylib13BufLineReaderEJRP6BigStrEEPT_DpOT0_ Line | Count | Source | 78 | 3 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 3 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 3 | "Expected no padding"); | 91 | | | 92 | 3 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 3 | #if MARK_SWEEP | 96 | 3 | int obj_id; | 97 | 3 | int pool_id; | 98 | 3 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 3 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 3 | #if MARK_SWEEP | 104 | 3 | header->obj_id = obj_id; | 105 | 3 | #ifndef NO_POOL_ALLOC | 106 | 3 | header->pool_id = pool_id; | 107 | 3 | #endif | 108 | 3 | #endif | 109 | 3 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 3 | memset(obj, 0, sizeof(T)); | 114 | 3 | return new (obj) T(std::forward<Args>(args)...); | 115 | 3 | } |
_Z5AllocI6Tuple2IiP6BigStrEJiS2_EEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI6Tuple3IiP6BigStrS2_EJiS2_S2_EEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI6Tuple4IiP6BigStrS2_iEJiS2_S2_iEEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI6Tuple2IiP6BigStrEJiRS2_EEPT_DpOT0_ Line | Count | Source | 78 | 2 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 2 | "Expected no padding"); | 91 | | | 92 | 2 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 2 | #if MARK_SWEEP | 96 | 2 | int obj_id; | 97 | 2 | int pool_id; | 98 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 2 | #if MARK_SWEEP | 104 | 2 | header->obj_id = obj_id; | 105 | 2 | #ifndef NO_POOL_ALLOC | 106 | 2 | header->pool_id = pool_id; | 107 | 2 | #endif | 108 | 2 | #endif | 109 | 2 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 2 | memset(obj, 0, sizeof(T)); | 114 | 2 | return new (obj) T(std::forward<Args>(args)...); | 115 | 2 | } |
_Z5AllocI6Tuple2IiPS0_IiP6BigStrEEJiRS4_EEPT_DpOT0_ Line | Count | Source | 78 | 1 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 1 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 1 | "Expected no padding"); | 91 | | | 92 | 1 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 1 | #if MARK_SWEEP | 96 | 1 | int obj_id; | 97 | 1 | int pool_id; | 98 | 1 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 1 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 1 | #if MARK_SWEEP | 104 | 1 | header->obj_id = obj_id; | 105 | 1 | #ifndef NO_POOL_ALLOC | 106 | 1 | header->pool_id = pool_id; | 107 | 1 | #endif | 108 | 1 | #endif | 109 | 1 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 1 | memset(obj, 0, sizeof(T)); | 114 | 1 | return new (obj) T(std::forward<Args>(args)...); | 115 | 1 | } |
_Z5AllocI4NodeJEEPT_DpOT0_ Line | Count | Source | 78 | 2 | T* Alloc(Args&&... args) { | 79 | | // Alloc() allocates space for both a header and object and guarantees that | 80 | | // they're adjacent in memory (so that they're at known offsets from one | 81 | | // another). However, this means that the address that the object is | 82 | | // constructed at is offset from the address returned by the memory allocator | 83 | | // (by the size of the header), and therefore may not be sufficiently aligned. | 84 | | // Here we assert that the object will be sufficiently aligned by making the | 85 | | // equivalent assertion that zero padding would be required to align it. | 86 | | // Note: the required padding is given by the following (according to | 87 | | // https://en.wikipedia.org/wiki/Data_structure_alignment): | 88 | | // `padding = -offset & (align - 1)`. | 89 | 2 | static_assert((-sizeof(ObjHeader) & (alignof(T) - 1)) == 0, | 90 | 2 | "Expected no padding"); | 91 | | | 92 | 2 | DCHECK(gHeap.is_initialized_); | 93 | | | 94 | 0 | constexpr size_t num_bytes = sizeof(ObjHeader) + sizeof(T); | 95 | 2 | #if MARK_SWEEP | 96 | 2 | int obj_id; | 97 | 2 | int pool_id; | 98 | 2 | void* place = gHeap.Allocate(num_bytes, &obj_id, &pool_id); | 99 | | #else | 100 | | void* place = gHeap.Allocate(num_bytes); | 101 | | #endif | 102 | 2 | ObjHeader* header = new (place) ObjHeader(T::obj_header()); | 103 | 2 | #if MARK_SWEEP | 104 | 2 | header->obj_id = obj_id; | 105 | 2 | #ifndef NO_POOL_ALLOC | 106 | 2 | header->pool_id = pool_id; | 107 | 2 | #endif | 108 | 2 | #endif | 109 | 2 | void* obj = header->ObjectAddress(); | 110 | | // Now that mycpp generates code to initialize every field, we should | 111 | | // get rid of this. | 112 | | // TODO: fix uftrace failure, maybe by upgrading, or working around | 113 | 2 | memset(obj, 0, sizeof(T)); | 114 | 2 | return new (obj) T(std::forward<Args>(args)...); | 115 | 2 | } |
|